-
Notifications
You must be signed in to change notification settings - Fork 39
Fix #41: Response builder broke header value #42
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,8 +135,8 @@ public function addHeader($headerLine) | |
sprintf('"%s" is not a valid HTTP header line', $headerLine) | ||
); | ||
} | ||
$name = trim(urldecode($parts[0])); | ||
$value = trim(urldecode($parts[1])); | ||
$name = trim($parts[0]); | ||
$value = trim($parts[1]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the urldecode was in there from the beginning. is something else doing that decoding in reality? is your test failing if you keep the urldecode here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
See comment for 60fe987
Yes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to me the urldecode is not necessary, only ascii characters are allowed. |
||
if ($this->response->hasHeader($name)) { | ||
$this->response = $this->response->withAddedHeader($name, $value); | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call this
it_splits_headers_correctly
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do the rename @dbu suggested as it better explains what we exactly test there.