-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
REST.php $I->haveHttpHeader not working as expected #1650
Comments
I have the same problem. PhpBrowser's setHeader and REST's haveHttpHeader work for all other headers, except "host". Seems like Symfony2 or Guzzle is replacing the host header. Maybe they are calling updateHeader instead of addHeader, which wouldn't overwrite an existing header. |
Yeah this one looks really funny ) |
I don't have any idea why... but this works ) |
The test passed because both headers were sent to server: array ( Probably case sensitivity was the original issue. |
testHostHeaders() is failing on hhvm-serve and I can't convince myself that modifying hhvm-serve to make this test pass is the right thing to do. It seems like the test is incorrect and it only passes because of case-sensitivity of getallheaders(). I feel inclined to delete the test, but is the fix code worth keeping? |
The cheat used to make the test pass doesn't work, |
I made a pull request to symfony to fix http_host handling: symfony/symfony#15427 |
My patch was accepted and released in Symfony 3.0.2, 2.8.3, 2.7.10 and 2.3.38 versions. |
My change was considered a BC-break and reverted in symfony/browser-kit v2.8.48, v3.4.19, v4.1.8 and v4.2.0-RC1. |
Well, not exactly reverted, but it behaves differently. |
@Naktibalda I'm running into similar issue with the $I->amOnUrl('https://www.google.com');
$I->amOnPage('/');
$I->haveHttpHeader('Host', 'www.wikipedia.org');
$I->amOnPage('/'); This is the output with debug:
As you can see in the response the first call to |
Yes, that's what it is doing. |
@Naktibalda Did you find any workaround to test |
I wasn't looking. |
I noticed that I can not set the Host header using:
When I do that, I see in my Apache log files that I'm getting the DNS name I used to make the request instead of the value I used e.g. "www.expected.com"
_However_ If I do the following:
I can see the value of "www.expected.com" in my Apache logs.
Is this a bug or a feature? Is this how I need to set header variables?
I'm using codeceptino 2.0.9 and php 5.5.10
The text was updated successfully, but these errors were encountered: