getodk / getodk/central

Consistency of limits on request body size

Open
#609 0 comments 0 reactions 0 assignees View on GitHub
backend frontend ops
Dominant language
JavaScript
Stars
226
Forks
235
Avg merge
2d 22h
Merged PRs (30d)
19

Description

Our nginx config specifies a [limit](https://github.com/getodk/central/blob/20dcbf46703ded595b82bda713c624673a3faff9/files/nginx/odk.conf.template#L19) of 100 MB on the size of the request body. Frontend and Backend implement similar limits:

- Before sending a file (e.g., a form attachment), Frontend [checks](https://github.com/getodk/central-frontend/blob/44de56877c2f7f49b225c5b65a56f7fe4d103bbb/src/composables/request.js#L90-L94) that the file doesn't exceed 100 MB. If it does, then Frontend won't even attempt to send the file and will show an error message (old discussion: #178).
- Backend [rejects](https://github.com/getodk/central-backend/pull/1123) JSON requests whose body is more than 250 kB. The exception is creating entities in bulk, in which case a request body of up to 100 MB is accepted.

Today we discussed the possibility that a user might try to change the nginx config, but wouldn't know to change Frontend as well. The Frontend code mentions the nginx config in a comment, but the nginx config doesn't mention Frontend.

Probably the best way to ensure that everything is consistent is to have Docker pass the limit to nginx, Frontend, and probably also Backend. Maybe the limit could be passed as an env variable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.