-
-
Notifications
You must be signed in to change notification settings - Fork 941
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
HPE_UNEXPECTED_CONTENT_LENGTH #646
Comments
Seems like I have already had a comparable issue with "request" module: A post in the same thread (request/request#2091 (comment)) suggests that the problem is due to server response including process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser; I doubt if Got can do much about this issue. Would be nice to have a test case at least so that we are aware of the issue. |
According to https://github.com/nodejs/node/blob/8b4af64f50c5e41ce0155716f294c24ccdecad03/deps/http_parser/http_parser.c The cause may be:
|
I can confirm that the subject response indeed includes chunked encoding & content length headers. -< HTTP/1.1 302 Found
-< cache-control: private
+< transfer-encoding: chunked
-< content-type: text/html; charset=utf-8
-< location: /[..]
-* Server Microsoft-IIS/8.5 is not blacklisted
-< server: Microsoft-IIS/8.5
-< x-aspnet-version: 4.0.30319
-* Added cookie AspxAutoDetectCookieSupport="1" for domain [..], path /, expire 0
-< set-cookie: AspxAutoDetectCookieSupport=1; path=/
-< x-powered-by: ASP.NET
-< date: Sat, 27 Oct 2018 10:54:51 GMT
-< connection: close
-< x-raygun-version: 4.17.1
-< x-raygun-request-id: 01CTTJK61183BHG2NN2WJXJA79
+< content-length: 228
-< x-rayman-checksum-sha256-hex: 110f5c9149e6c2fd977182943ab2ea5a16a4e913fff4d7539e17539dfaabbc31
-< x-rayman-cache-hit: false
-< x-rayman-forward-proxy: [..]
|
Unfortunately, there's nothing Got can do about that :/ |
It could use the custom parser, though thats probably excessive. Either way, nice to have it documented in the issue thread. The solution is to change the HTTP parser globally. process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser; |
I can confirm that changing the parser fixes the issue. |
My logger includes hundreds of errors such as this:
Stack trace refers to Got as the source of the issue:
Is anyone familiar with error/ know whats the workaround?
The text was updated successfully, but these errors were encountered: