Skip to content

Commit

Permalink
bug: leaking database information in some problem messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
issa-tseng committed Apr 21, 2020
1 parent 7491e51 commit c90b095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/resources/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module.exports = (service, endpoint) => {
.then((form) => auth.canOrReject('form.update', form))
.then(rejectIf(
(form) => (form.draftDefId == null),
Problem.user.notFound
() => Problem.user.notFound()
))
.then((form) => Promise.all([
// TODO: for now we just cast away the draft to nothing. eventually probably sweep+delete.
Expand Down
6 changes: 3 additions & 3 deletions lib/resources/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = (service, endpoint) => {
.then(ensureDef)
.then(rejectIf(
(form) => !form.acceptsSubmissions(),
Problem.user.notAcceptingSubmissions
() => Problem.user.notAcceptingSubmissions()
))
.then((form) => auth.canOrReject('submission.create', form)));

Expand All @@ -134,7 +134,7 @@ module.exports = (service, endpoint) => {
.then(ensureDef)
.then(rejectIf(
((form) => (params.key !== form.def.draftToken) || isBlank(form.def.draftToken)),
Problem.user.notFound
() => Problem.user.notFound()
));
});

Expand Down Expand Up @@ -174,7 +174,7 @@ module.exports = (service, endpoint) => {
.then(ensureDef)
.then(rejectIf(
(form) => !form.acceptsSubmissions(),
Problem.user.notAcceptingSubmissions
() => Problem.user.notAcceptingSubmissions()
)));

restSubmission('/projects/:projectId/forms/:formId/draft/submissions', ({ projectId, formId }, Form) =>
Expand Down

0 comments on commit c90b095

Please sign in to comment.