-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
HTTP API needs POST for large parameters in NodeJS 8.14+ #3568
Comments
On further inspection, the API already has some support for |
Potential fix in branch Please advise if the preference is to allow only body parameters in an HTTP POST and if so I'll amend the patch and tests accordingly. Also, the EP docs make no mention of HTTP POST support nor how to use it. I'll wait to submit a PR until I hear back. |
But them, I did not write the API spec, and it is on the wild for a long time now, so we have to take care of backwards compatibility. My vote is towards retaining GET, and allowing POST. |
In which case I think you should be able to cherry pick that commit, although the API documentation does need an update to mention POST and the need to use it if the data is too large. |
(sorry I hit CTRL+ENTER and posted an half backed comment). Apart from the documentation (that should be updated), would it be possible to print a WARN in the logs when receiving a GET with a too big payload on node 8.14+? That would give an operator some hints about what needs to be done to maintain a working installation. If, instead, it is the node runtime that discards the request at a low level, it would never hit the application, and no log could be generated, obviously. |
I'm a little fuzzy on the details right now, but ISTR it was the latter. The question on The disadvantage of the "body only" approach is that it then becomes mandatory to put things like the |
The approach taken in your patch ( Ignore my comment on using GET vs POST: it was a rambling about how I would have designed the API in the first place. Totally not relevant now. |
Note to self for the documentation:
|
…tHTML() This is allowed starting from fc661ee ("core: allow URL parameters and POST bodies to co-exist"), which landed in Etherpad 1.8.0. For the discussion, see issue ether#3568.
NodeJS 8.14.0 introduced a limit of 8KB to the size of HTTP headers that can be received.
This prevents HTTP API methods such as
setText
from working if the text content exceeds that size.A possible solution would be to support the
POST
method in addition toGET
, with any JSON object found in the HTTP body augmenting the URL parameters.The text was updated successfully, but these errors were encountered: