Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Limits the attachment upload size by changing to using a POST request for uploads allowing specific conditions to be specified (see #17 comments for what happened when spoofing the content length in the header). The data returned is now not just an
upload_url
but insteadupload_info
with both aurl
andfields
that should be POSTed along with the file data.I have tried modifying the key in these fields and verified that it denies the request as it breaks the policy.
If testing with something like postman/insomnia you need to use a
form-data
body with all thefields
returned by the/attachments
POST endpoint, and an additional onefile
with the actual file data. Internally the content boundary is also set by postman or in the e2e tests through using thefiles
parameter in the requests module. I am not quite sure what that would translate to on the front end but I assume either the browser or uppy will do it.Testing instructions
Add a set up instructions describing how the reviewer should test the code
Agile board tracking
Closes #17