Skip to content

Wrong headers #47

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

Closed
dzubchik opened this issue Nov 17, 2016 · 4 comments
Closed

Wrong headers #47

dzubchik opened this issue Nov 17, 2016 · 4 comments

Comments

@dzubchik
Copy link
Contributor

Hi! We have recently megred #46, but unfortunately, it brings a bug. When we call "add" method
https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L183, we add headers from React request, but we can not track headers which were added by Symfony request from ServerBag. As it uses superglobal array $_SERVER, which only grows during application lifetime. For example:
I send regular http request, after that I send ajax request, all furtherst requests will have X-Request-With: XMLHttpRequest header. My propose is to return replace method, but move authorization headers from $_SERVER to $headers.

@marcj
Copy link
Member

marcj commented Nov 17, 2016

How about resetting $_SERVER at the beginning of the method?

@dzubchik
Copy link
Contributor Author

I don't think that resetting superglobal is ok. And, furthermore, Symfony ServerBag uses it to populate headers.

@marcj
Copy link
Member

marcj commented Nov 17, 2016

Yes, this is an issue, because $_SERVER should contain always only headers from the $request, not from the first php bootstrap. We need to reset it anyways.

@dzubchik
Copy link
Contributor Author

dzubchik commented Dec 6, 2016

This commit fixes this php-pm/php-pm@9b63b99.

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

2 participants