Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HTTPFoundation] fixed stripped HTTP_AUTHORIZATION headers #7649

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
wants to merge 1 commit into from
Closed

[HTTPFoundation] fixed stripped HTTP_AUTHORIZATION headers #7649

wants to merge 1 commit into from

Conversation

Sgoettschkes
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #7170
License MIT
Doc PR -

I am not 100% sure about this PR. I didn't find a way to add proper tests and I am relying on what my apache looks like and what the issue #7170 told.

Populating the $server variable passed to the request with apache_request_headers() if available.
$request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
$server = $_SERVER;
if (function_exists('apache_request_headers') && apache_request_headers() !== false) {
$server = array_merge(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be array_replace as it's a key-value array ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, array_merge only behaves different if numeric keys are involved. As all keys should be non-numeric, I can change it to use array_replace if it's a better fit for this situation.

@fabpot
Copy link
Member

fabpot commented Apr 20, 2013

I fear that this is slowing down things lot. Looking at the impl, I stumbled about this other PR #3551, which looks like a better approach.

@fabpot
Copy link
Member

fabpot commented Apr 21, 2013

Closing in favor of a documentation update: see symfony/symfony-docs#2529

@andig
Copy link

andig commented Nov 11, 2017

@fabpot the documentation update is missing a key point. While php-cgi does not pass the BASIC authentication header, php in general does not pass the BEARER authentication header at all. To get this header accessing the apache native function is required.

Is it worth re-discussing this in #19693 (comment) or reopening here?

@xabbuh
Copy link
Member

xabbuh commented Nov 13, 2017

@andig Please open an issue in the documentation repository if you think we can clarify it.

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

Successfully merging this pull request may close these issues.

5 participants