[Zend\Http\Client] dupplicate header keys in prepareHeaders #5065

Closed
wants to merge 4 commits into
from

Projects

None yet

2 participants

Contributor

in my mind I found a bug in the Http Component. In my gist I write a TestCase to show the error.

if we you a toString-Methode from \Zend\Http\Header\ContentType

https://gist.github.com/ClemensSahs/6421612

The provenance from this issues is in the method \Zend\Http\Client::prepareHeaders here we use not the lowercase string for the header keys like the \Zend\Http\Header\* So we get this.

// 1st ( store )
array(6) {
  ["Host"]=>
  string(14) "127.0.0.1:5984"
  ["Connection"]=>
  string(5) "close"
  ["Accept-Encoding"]=>
  string(13) "gzip, deflate"
  ["User-Agent"]=>
  string(16) "Zend\Http\Client"
  ["Content-Length"]=>
  int(13)
  ["content-type"]=>
  string(16) "application/json"
}

// 2nd ( get )
array(5) {
  ["Host"]=>
  string(14) "127.0.0.1:5984"
  ["Connection"]=>
  string(5) "close"
  ["Accept-Encoding"]=>
  string(13) "gzip, deflate"
  ["User-Agent"]=>
  string(16) "Zend\Http\Client"
  ["Content-Type"]=>
  string(16) "application/json"
}
// 3rd ( store )
array(7) {
  ["Host"]=>
  string(14) "127.0.0.1:5984"
  ["Connection"]=>
  string(5) "close"
  ["Accept-Encoding"]=>
  string(13) "gzip, deflate"
  ["User-Agent"]=>
  string(16) "Zend\Http\Client"
  ["Content-Type"]=>
  string(16) "application/json"
  ["Content-Length"]=>
  int(13)
  ["content-type"]=>
  string(16) "application/json"
}

best regards

Owner

Please add a unit test as well to document the why of the change. Thanks in advance!

Contributor

what kind of document you meen, I think you mean inline doc right?

Owner

@ClemensSahs I meant that the test will document why the change is being made, not that you need to write documentation. :)

Contributor

@weierophinney ok the test control tow possible way for the same error case... currently I have no alternative error case for this isseus...

from my side we are fine, any feedback?

@weierophinney weierophinney added a commit that referenced this pull request Sep 4, 2013
@weierophinney weierophinney Merge branch 'hotfix/5065' into develop
Forward port #5065
2b83769
@weierophinney weierophinney added a commit that referenced this pull request Sep 4, 2013
@weierophinney weierophinney Merge branch 'hotfix/5065'
Close #5065
2a33a10
@weierophinney weierophinney was assigned Sep 4, 2013
@gianarb gianarb pushed a commit to zendframework/zend-http that referenced this pull request May 15, 2015
@ClemensSahs ClemensSahs fix zendframework/zendframework#5065 c4f8f74
@weierophinney weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#5065 from ClemensSahs/…
…hotfix/5042

[Zend\Http\Client] dupplicate header keys in prepareHeaders

Conflicts:
	tests/ZendTest/Http/ClientTest.php
5a46d9b
@weierophinney weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5065' b0a1695
@weierophinney weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5065' into develop f05b8f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment