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

Issue parsing big header #5

Open
xumo opened this issue Jul 19, 2017 · 0 comments
Open

Issue parsing big header #5

xumo opened this issue Jul 19, 2017 · 0 comments

Comments

@xumo
Copy link

xumo commented Jul 19, 2017

If the header is bigger than 512 (bytes?), the size of the buffer I thinks, then it only parses it partialy. If Conten-Length is not foeund then it doesn't even keep reading to get the body part.

For now I just hack my way arround this, but it would be great if the HttpResponse::parseHeader sets mHasHeader to true only if it reaches the end of a header and appends the remaining in subsequent passes.

This is the kind of response I'm getting from a Laravel(php) service:

First response

HTTP/1.1 200 OK
Date: Wed, 19 Jul 2017 09:13:30 GMT
Server: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7
X-Powered-By: PHP/7.1.7
Cache-Control: no-cache, private
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
Set-Cookie: XSRF-TOKEN=eyJpdiI6IjdLSHdwTU1DTTI3UUh1VjFuNDlBd1E9PSIsInZhbHVlIjoiemN0WXR1NThRc0hpMjlUSkhBRVNaTFVKcUlzeG5VZ3NaUTFlUlAxcGtwQXJXSWdMejRWVXBPc0xIM3ZYMjZERStqbjlxXC9DdUphVncwWU5hKzlxdXJBPT0iLCJtYWMiOiJhMTdiZmI1YmYzNDM4YmNlOWRlMGU5M2U5ZjNjZWI5OGY2ODFjMWYwNzA3N2ViODEwMTI4MmI5NGMxZmQxMjF

In a second pass

hIn0%3D; expires=Wed, 19-Jul-2017 11:13:31 GMT; Max-Age=7200; path=/
Set-Cookie: laravel_session=JCCr9pQ7G3K2xqccFZllgJHNRGo45HiMSQs18yvz; expires=Wed, 19-Jul-2017 11:13:31 GMT; Max-Age=7200; path=/; HttpOnly
Content-Length: 71
Content-Type: text/json; charset=UTF-8

{"code":0,"data":"viMZYFp1qfRSZtyX9ISBb1uA5KJjxclTgm7OK05D","error":[]}

The Set-Cookie line gets broken, tha might be dificutl for the parser to handle, but I'll dig into it later.~

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

1 participant