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

Http custom headers problem #33

Open
sobradovic opened this issue Mar 25, 2015 · 3 comments
Open

Http custom headers problem #33

sobradovic opened this issue Mar 25, 2015 · 3 comments

Comments

@sobradovic
Copy link

Custom headers have been capitalized. When I send my custom header in order to testing Rest service, for example: BOOK-ALL, it will be converted to Book-All, so my rest service receives the wrong header.
Custom header should not be changed.

@Naktibalda
Copy link
Member

REST module converts headers to all capitals and with underscores, e.g. BOOK-ALL is converted to HTTP_BOOK_ALL

https://github.com/Codeception/Codeception/blob/b071d6a47af9cebc306f1471de874ad2cf097671/src/Codeception/Module/REST.php#L360

Conversion to ucfirst style is performed by Guzzle connector:

https://github.com/Codeception/Codeception/blob/cdc3569fedb017eea204b40eae0c82cf726e0107/src/Codeception/Lib/Connector/Guzzle.php#L210

I copied extractHeaders method from Guzzle to ZF1 and ZF2 connectors, so they will have the same behaviour, but I don't know if any of those conversions are necessary.

@eXorus eXorus transferred this issue from Codeception/Codeception Oct 28, 2020
@SamMousa
Copy link
Contributor

@SamMousa
Copy link
Contributor

Header names are case insensitive so your code should not rely on any specific casing

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

3 participants