-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON body parser has a hardcoded limit of 1mb #168
Comments
Seems like CouchDB has a 4GB limit by default (http://docs.couchdb.org/en/latest/config/couchdb.html#couchdb/max_document_size). We could implement that config option too I guess. I do wonder if setting it to 4GB doesn't make it too easy to make the server run out of memory with just a few clients, though. |
Yeah. That was pretty large, though for bulk uploads I can understand it. For single docs I don't. Though; what if we made this configurable and follow the default value in CouchDB? Would you be happy with that? |
I guess there are easier ways to make express-pouchdb crash for now. And CouchDB probably has the same problem concerning running out of memory easily this way. I'd like some input from someone else though before definitly comitting to that solution. |
This should really be a config option and ideally there should be a clear error associated with it so that the person running the server (and the person receiving the error) have some clue as to what happened. I also want a pony. |
I agree with @yaronyg. |
Ok, then I'm fine with cloning PouchDB's behaviour (implementing |
CouchDB's error is: The exact default value is: |
Implemented, I opened a PR: #179. |
The JSON body parser used to parse incoming requests has a hardcoded value of 1mb.
This is more or less fine when posting one and one document but a limit of 1mb becomes pretty small when one post documents with the bulk-docs route. The main reason for using the bulk-docs route is mainly to be able to post larger amounts of data in one go.
It is also the case that when trying to post something over 1mb one just get a 400 bad request in return and no indications on what the error is. It would have been nice to be able to see in some kind of log that one tried to post something above such a limit.
I think this should be configurable and perhaps different limits when posting single docs and bulk posting docs. I also think it should be some kind of log message if one try to post something above this.
I'll gladly create PR if you could give some advice on how you would like to handle this.
The text was updated successfully, but these errors were encountered: