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

Missing headers with same names (like Set-Cookie) #8

Open
myadzel opened this issue Oct 27, 2017 · 2 comments
Open

Missing headers with same names (like Set-Cookie) #8

myadzel opened this issue Oct 27, 2017 · 2 comments

Comments

@myadzel
Copy link

myadzel commented Oct 27, 2017

Parsing this response

HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Security-Policy: script-src 'self'
Strict-Transport-Security: max-age=31536000
Set-Cookie: JSESSIONID=1AF9A42DC89C0CD2620ECE5449074DF1.PPM1-1; Path=/itg/; HttpOnly
Set-Cookie: JSESSIONID=1AF9A42DC89C0CD2620ECE5449074DF1.PPM1-1; path=/itg; HTTPOnly
Accept-Language: ru_RU
Cache-Control: no-cache, post-check=0, pre-check=0
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 25 Oct 2017 12:57:35 GMT
Server: 

produce result without second Set-Cookie header

{
     'X-Frame-Options': 'SAMEORIGIN',
     'X-XSS-Protection': '1; mode=block',
     'X-Content-Security-Policy': 'script-src \'self\'',
     'Strict-Transport-Security': 'max-age=31536000',
     'Set-Cookie': 'JSESSIONID=1AF9A42DC89C0CD2620ECE5449074DF1.PPM1-1; path=/itg; HTTPOnly',
     'Accept-Language': 'ru_RU',
     'Cache-Control': 'no-cache, post-check=0, pre-check=0',
     'Content-Type': 'text/html;charset=UTF-8',
     'Transfer-Encoding': 'chunked',
     Date: 'Wed, 25 Oct 2017 12:57:35 GMT',
     Server: ''
}
@honzajavorek
Copy link
Contributor

My hunch would be that http-string-parser is internally using an object instead of an array to store the HTTP headers. Would you be willing to send a PR with a fix?

@myadzel
Copy link
Author

myadzel commented Nov 2, 2017

Would you be willing to send a PR with a fix?

No, I wrote my own parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants