Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] don't call getTrustedHeaderName() if possible#22873

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@xabbuh
Copy link
Member

@xabbuhxabbuh commentedMay 23, 2017
edited
Loading

QA
Branch?3.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketshttps://travis-ci.org/symfony/symfony/jobs/235008102 (failing tests of#22863)
LicenseMIT
Doc PR

$currentXForwardedFor =$request->headers->get($trustedHeaderName,'');

$server['HTTP_'.$trustedHeaderName] = ($currentXForwardedFor ?$currentXForwardedFor.',' :'').$request->getClientIp();
}elseif (Request::HEADER_X_FORWARDED_FOR & Request::getTrustedHeaderSet()) {
Copy link
Member

Choose a reason for hiding this comment

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

Actually, the non-deprecated API should be tried first, to use it when it is available IMO

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

In fact, I think that we can just fix this in 3.3.

@xabbuhxabbuhforce-pushed thehttp-foundation-forward-compatibility branch fromcd52a80 to29c9d8cCompareMay 23, 2017 13:33
@xabbuhxabbuh changed the base branch from3.4 to3.3May 23, 2017 13:34
@xabbuhxabbuhforce-pushed thehttp-foundation-forward-compatibility branch from29c9d8c to0ae049bCompareMay 23, 2017 13:34
@xabbuhxabbuh modified the milestones:3.3,3.4May 23, 2017
@xabbuhxabbuhforce-pushed thehttp-foundation-forward-compatibility branch from0ae049b toccf2275CompareMay 23, 2017 13:35
// will be included into trusted header for client ip
try {
if ($trustedHeaderName = Request::getTrustedHeaderName(Request::HEADER_CLIENT_IP,false)) {
$hasTrustedHeaderSet =method_exists(Request::class,'getTrustedHeaderSet');
Copy link
Member

Choose a reason for hiding this comment

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

I would avoid this check by bumping the min version of HttpFoundation in HttpKernel

@xabbuhxabbuhforce-pushed thehttp-foundation-forward-compatibility branch 2 times, most recently from7e0c424 tob17d932CompareMay 23, 2017 14:17
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

@xabbuhxabbuhforce-pushed thehttp-foundation-forward-compatibility branch fromb17d932 to6350dabCompareMay 23, 2017 18:23
@xabbuhxabbuh changed the title[HttpKernel] FC with HttpFoundation 4.0[HttpKernel] don't call getTrustedHeaderName() if possibleMay 23, 2017
@nicolas-grekas
Copy link
Member

Thank you@xabbuh.

@nicolas-grekasnicolas-grekas merged commit6350dab intosymfony:3.3May 25, 2017
nicolas-grekas added a commit that referenced this pull requestMay 25, 2017
… (xabbuh)This PR was merged into the 3.3 branch.Discussion----------[HttpKernel] don't call getTrustedHeaderName() if possible| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |https://travis-ci.org/symfony/symfony/jobs/235008102 (failing tests of#22863)| License       | MIT| Doc PR        |Commits-------6350dab don't call getTrustedHeaderName() if possible
@xabbuhxabbuh deleted the http-foundation-forward-compatibility branchMay 25, 2017 13:43
@fabpotfabpot mentioned this pull requestMay 29, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

4 participants

@xabbuh@nicolas-grekas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp