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

strtolower() expects parameter 1 to be string, array given #117

Closed
DangerLifter opened this issue Jan 4, 2018 · 1 comment · Fixed by #122
Closed

strtolower() expects parameter 1 to be string, array given #117

DangerLifter opened this issue Jan 4, 2018 · 1 comment · Fixed by #122

Comments

@DangerLifter
Copy link

DangerLifter commented Jan 4, 2018

Got an exception: strtolower() expects parameter 1 to be string, array given in /http-client/src/Response.php:36

Test url with problem: http://mosmama.info/org/user/2275/contact

Issues happens because header "transfer-encoding" contains "Transfer-Encoding: chunked, chunked"
Browser "Firefox" processes this case correctly.

DangerLifter pushed a commit to DangerLifter/http-client that referenced this issue Jan 4, 2018
DangerLifter pushed a commit to DangerLifter/http-client that referenced this issue Jan 4, 2018
@clue
Copy link
Member

clue commented Jan 16, 2018

Thank you for reporting, I can confirm that there's an issue in this library 👍

The Response class should not report an error here and try to handle this situation in a sane way as per RFC 7230: https://tools.ietf.org/html/rfc7230#section-3.3.3

Note that this URL you've provided is indeed "invalid" as it actually uses double encoded chunks, so this doesn't render properly in Firefox or any other HTTP client either. As per the HTTP specs the HTTP client should interpret one such encoding and thus return a response that is still encoded once.

It may take a while before I get to look into this, so any help with addressing this is much appreciated :shipit:

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

Successfully merging a pull request may close this issue.

2 participants