Skip to content

Conversation

josch1710
Copy link
Contributor

This push request solves issue #170 by moving the code from Response::_parseCode to Response\Headers::fromString.

@josch1710 josch1710 closed this May 11, 2015
josch1710 added 3 commits May 22, 2015 15:16
Response\Headers lowercases header names.
Before header names were only lowercased when created by fromString.
@josch1710 josch1710 reopened this May 22, 2015
@@ -464,7 +464,7 @@ function testMultiHeaders()
$req = Request::init();
$response = new Response(self::SAMPLE_JSON_RESPONSE, self::SAMPLE_MULTI_HEADER, $req);
$parse_headers = $response->_parseHeaders(self::SAMPLE_MULTI_HEADER);
$this->assertEquals('Value1,Value2', $parse_headers['X-My-Header']);
$this->assertEquals('Value1,Value2', $parse_headers['x-my-header']);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. This means that this will be a breaking change. Code that relied on the capitalization will break. Can we keep this backwards compatible and keep the capitalization?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The culprit is the upstream implementation of Response\Headers::fromString. There the keys are stored lower case. I retained that behavior, and so had to change the test.
Should I drop the lower case?

@josch1710
Copy link
Contributor Author

How should I handle the lower case problem?

@josch1710
Copy link
Contributor Author

Hi there.

How should I handle the lower case problem?

@josch1710
Copy link
Contributor Author

I removed the lower case code and reverted the test

@josch1710
Copy link
Contributor Author

I just fixed all the issues. Headers remain as entered.

voku added a commit to voku/httpful that referenced this pull request Apr 30, 2016
@josch1710
Copy link
Contributor Author

Is there any intereset oin this pull request by upstream?

@nategood
Copy link
Owner

Absolutely.

@nategood nategood merged commit fc8e427 into nategood:master Jul 22, 2016
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

Successfully merging this pull request may close these issues.

2 participants