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
HTTP/1.1 200 OK
transfer-encoding: chunked
connection: keep-alive
date: Wed, 10 Jun 2020 22:26:51 GMT
1\r\n
x\r\n
0\r\n
\r\n
Actual:
HTTP/1.1 200 OK
content-length: 0
connection: keep-alive
date: Wed, 10 Jun 2020 22:26:51 GMT
x
Note that this is illegal HTTP. content-length is set to 0 and then we're still emitting characters. That should not be possible. For a user-facing API, there should be two options:
user supplies the content length in which case Vapor should validate and crash with good message if there's more or fewer bytes
user does not supply the content length in which case Vapor should automatically set transfer-encoding: chunked (or not add content-length: 0 which will make NIO add transfer-encoding: chunked).
The text was updated successfully, but these errors were encountered:
With my echo server
Even when driving it correctly, vapor responds with illegal HTTP.
Repro:
echo -ne 'POST /echo HTTP/1.1\r\ntransfer-encoding: chunked\r\n\r\n1\r\nx\r\n0\r\n\r\n' | nc localhost 8080
Expected:
Actual:
Note that this is illegal HTTP.
content-length
is set to0
and then we're still emitting characters. That should not be possible. For a user-facing API, there should be two options:transfer-encoding: chunked
(or not addcontent-length: 0
which will make NIO addtransfer-encoding: chunked
).The text was updated successfully, but these errors were encountered: