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
Initially I filed fpco/http-reverse-proxy#44, but then I decided to test if http-client itself works properly in the presence of HTTP 103 early hints, and it seems it does not.
I added another repro alongside my existing one, so you can check it as follows. The meat of it is here.
cd $(mktemp -d)
git clone [email protected]:codedownio/http-reverse-proxy.git --branch http-103-early-hints-repro
npm install && npm run start # Starts a test Node.js server
# Now switch to the same folder in another terminal and do
stack run client-test
This will use http-client to make a normal request, as well as an early-hints request.
Normal request output
Doing an HTTP request to http://localhost:3005/simple
The status code was: 200
Full response: Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("X-Powered-By","Express"),("Content-Type","text/html; charset=utf-8"),("Content-Length","16"),("ETag","W/\"10-uViC3pa4b5/U2h5JkCXIHUyMvk0\""),("Date","Wed, 22 Nov 2023 07:25:23 GMT"),("Connection","keep-alive"),("Keep-Alive","timeout=5")], responseBody = "Simple response!", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
"Simple response!"
Early hints request output
Doing an HTTP request to http://localhost:3005/early_hints
The status code was: 103
Full response: Response {responseStatus = Status {statusCode = 103, statusMessage = "Early Hints"}, responseVersion = HTTP/1.1, responseHeaders = [("Link","</some-file.js>")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
""
It seems that http-client sees the HTTP 103 status line and thinks it's at the end of the request. It gets the headers, but doesn't proceed to get the final status code or the response body.
The text was updated successfully, but these errors were encountered:
Initially I filed fpco/http-reverse-proxy#44, but then I decided to test if
http-client
itself works properly in the presence of HTTP 103 early hints, and it seems it does not.I added another repro alongside my existing one, so you can check it as follows. The meat of it is here.
This will use
http-client
to make a normal request, as well as an early-hints request.Normal request output
Early hints request output
It seems that
http-client
sees theHTTP 103
status line and thinks it's at the end of the request. It gets the headers, but doesn't proceed to get the final status code or the response body.The text was updated successfully, but these errors were encountered: