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

Empty values for headers are skipped #4287

tobiastom opened this issue May 31, 2017 · 1 comment

Empty values for headers are skipped #4287

tobiastom opened this issue May 31, 2017 · 1 comment


Copy link

@tobiastom tobiastom commented May 31, 2017

What are you trying to achieve?

I'm trying to set a DNT header to the value of 0, as it is described in the specification:

$I->haveHttpHeader('DNT', '0');

What do you get instead?

The DNT header is not set to the server as it is skipped.


The problem is in this line of code:

if (!$val) {

The string value 0 is evaluated as false and will not be send.
A possible solution would be to check if the value is a string, and if it is use it anyway. I could create a pull request for this, if it is an acceptable fix for you.

Copy link

@Naktibalda Naktibalda commented May 31, 2017

To behave in the same way as set_cookie function that condition should be if($val === null || $val === '') { continue; }

Please make a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.