You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following example which is a multipart upload with a maximum length set behaves in a way that I think is incorrect. I use commit a9fb5d6eb00ded502b021672779dd76c777680cd of warp which is recent on master
Using this CURL command: curl -vvv http://localhost:3030/upload/blergh.img -F file=@toolarge.bin
where toolarge.bin is larger than 1024 * 1024 * 10, I receive a "100 Continue" even though the header is not OK (content-length is too large).
> POST /upload/blergh.img HTTP/1.1
> Host: localhost:3030
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Length: 11534536
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------808fc7c117e269f5
>
< HTTP/1.1 100 Continue
< HTTP/1.1 413 Payload Too Large
< content-type: text/plain; charset=utf-8
< content-length: 32
< date: Fri, 17 Jan 2020 12:53:41 GMT
* HTTP error before end of send, stop sending
<
* Curl_http_done: called premature == 0
* Closing connection 0
The request payload is too large
This confuses clients making them believe they should start sending data. And it causes issues when warp is placed behind a reverse proxy as the closed connection will make at least Apache respond with a 502 gateway error and swallow the error message passed by warp. Curl, and other clients, set the header Expect: 100-continue which indicate they want Content-Length to be verified before sending more data:
I'm not sure my understanding of the behavior is entirely correct. What I do know is that placing a Warp server behind Apache as a reverse proxy will result in a 502 and a generic Apache error instead of the error returned by Warp.
You're understanding is correct, this behavior happens in hyper due to it automatically responding with a 100 Continue no matter what. There's this issue regarding fixing that to only send the 100 Continue if the user tries to read from the body.
The following example which is a multipart upload with a maximum length set behaves in a way that I think is incorrect. I use commit
a9fb5d6eb00ded502b021672779dd76c777680cd
of warp which is recent on masterUsing this CURL command:
curl -vvv http://localhost:3030/upload/blergh.img -F file=@toolarge.bin
where toolarge.bin is larger than 1024 * 1024 * 10, I receive a "100 Continue" even though the header is not OK (content-length is too large).
This confuses clients making them believe they should start sending data. And it causes issues when warp is placed behind a reverse proxy as the closed connection will make at least Apache respond with a 502 gateway error and swallow the error message passed by warp. Curl, and other clients, set the header
Expect: 100-continue
which indicate they wantContent-Length
to be verified before sending more data:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect
The text was updated successfully, but these errors were encountered: