Skip to content
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

HttpApi server can't read chunked request #332

Closed
pavelmash opened this issue Jul 16, 2020 · 4 comments
Closed

HttpApi server can't read chunked request #332

pavelmash opened this issue Jul 16, 2020 · 4 comments

Comments

@pavelmash
Copy link
Sponsor Collaborator

Current implementation of THttpApiServer always expect Content-Length header to be present - https://github.com/synopse/mORMot/blob/master/SynCrtSock.pas#L9307

In case of Transfer-Encoding: chunked content length not present and we got an empty request body.

Command to reproduce:

curl -H "Transfer-Encoding: chunked" -H "Content-Type: text/xml;charset=UTF-8" -d "chunk of data" http://localhost:8881/anyUri
@synopse
Copy link
Owner

synopse commented Jul 16, 2020

So how do we fix this?

@pavelmash
Copy link
Sponsor Collaborator Author

For a while I setup an nginx as a reverse proxy (on windows we usually not use it) and enable request buffering on nginx level. In such configuration nginx transform chunked HTTP request into usual request with Content-Length header. So such work-aroud can be used. Let's keep this issue open just to know what problem exists..

@synopse
Copy link
Owner

synopse commented Jul 16, 2020

Fair enough.

@synopse
Copy link
Owner

synopse commented Aug 26, 2021

I will close it until we really need this feature.
And in mORMot 2 I guess.

@synopse synopse closed this as completed Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants