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

HPE_INVALID_HEADER_TOKEN error while fetching an image #1884

Closed
ApsOps opened this issue Nov 2, 2015 · 5 comments
Closed

HPE_INVALID_HEADER_TOKEN error while fetching an image #1884

ApsOps opened this issue Nov 2, 2015 · 5 comments
Labels

Comments

@ApsOps
Copy link

ApsOps commented Nov 2, 2015

Steps to reproduce:

var request = require('request')
request('https://facestore.pt/images/11522/products/10_1_20151002092830_img_b.jpg')

I receive the following error:

{ [Error: Parse Error] bytesParsed: 152, code: 'HPE_INVALID_HEADER_TOKEN' }

Stack trace:

Error: Parse Error
   at Error (native)
   at TLSSocket.socketOnData (_http_client.js:305:20)
   at emitOne (events.js:77:13)
   at TLSSocket.emit (events.js:169:7)
   at readableAddChunk (_stream_readable.js:146:16)
   at TLSSocket.Readable.push (_stream_readable.js:110:10)
   at TLSWrap.onread (net.js:523:20)
@evanlucas
Copy link

curl -IS 'https://facestore.pt/images/11522/products/10_1_20151002092830_img_b.jpg'

returns

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 09 Nov 2015 02:58:16 GMT
Content-Type: image/jpeg
Content-Length: 69633
Connection: close
X-Frame-Options="ALLOW-FORM: facebook.com"
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT
Access-Control-Max-Age: 1000
Access-Control-Allow-Headers: x-requested-with, Content-Type, origin, authorization, accept, client-security-token
Last-Modified: Fri, 02 Oct 2015 08:28:30 GMT
ETag: "aa08cc-11001-5211af2ce60c3"
Accept-Ranges: bytes
Strict-Transport-Security: max-age=31536000; includeSubdomains

I'm guessing that the X-Frame-Options="ALLOW-FORM: facebook.com" is what is causing it in node's http parser.

@simov
Copy link
Member

simov commented Nov 9, 2015

@evanlucas, good point! Should we address this issue in the node's tracker?

@evanlucas
Copy link

I would probably open an issue at https://github.com/nodejs/http-parser/issues.

@regevbr
Copy link

regevbr commented May 10, 2017

https://github.com/creationix/http-parser-js fixed the issue for me

@stale
Copy link

stale bot commented Nov 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 23, 2018
@stale stale bot closed this as completed Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants