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

Don't assume port 0 for X-Forwarded-Port#32096

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

Merged
fabpot merged 4 commits intosymfony:3.4fromalexbowers:patch-2
Jul 8, 2019
Merged

Don't assume port 0 for X-Forwarded-Port#32096

fabpot merged 4 commits intosymfony:3.4fromalexbowers:patch-2
Jul 8, 2019

Conversation

@alexbowers
Copy link
Contributor

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?none added
Fixed tickets
LicenseMIT
Doc PR-

If you use X-Forwarded-Host but don't provide X-Forwarded-Port, it will default to0.0.0.0: which then assumes port0 instead of following its default assumption based on the scheme.

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneJun 19, 2019
@nicolas-grekas
Copy link
Member

Could you please add a test case?

@alexbowers
Copy link
ContributorAuthor

@nicolas-grekas I've added a test for this.

@alexbowers
Copy link
ContributorAuthor

Hmm, strange, its failing on the tests. But passes locally. I'll take a look at that this evening.

@alexbowers
Copy link
ContributorAuthor

I'm a little confused, it is failing on php 5.5, but is fine on php 7.0+. Nothing I changed should affect 5.5, any ideas?

@xabbuh
Copy link
Member

@alexbowers PHP changed howsubstr() behaved when the start parameter is the same as the length of the string (see alsohttps://www.php.net/manual/en/function.substr.php andhttps://3v4l.org/tfZgp).

@alexbowers
Copy link
ContributorAuthor

Ah, thank you@xabbuh

@alexbowers
Copy link
ContributorAuthor

Hmm, can AppVeyor be re-ran?

I can't see any cause for it failing.

$request = Request::create('/');
$request->server->set('REMOTE_ADDR','1.1.1.1');
$request->headers->set('X-Forwarded-Host','test.example.com');
$request->headers->set('X-Forwarded-Port',null);
Copy link
Contributor

Choose a reason for hiding this comment

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

HeaderBag::set does not accept null. Maybe you meant to use an empty string.

Copy link
Member

Choose a reason for hiding this comment

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

@fabpot
Copy link
Member

Thank you@alexbowers.

@fabpotfabpot merged commitadcdd93 intosymfony:3.4Jul 8, 2019
fabpot added a commit that referenced this pull requestJul 8, 2019
This PR was merged into the 3.4 branch.Discussion----------Don't assume port 0 for X-Forwarded-Port| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | none added| Fixed tickets || License       | MIT| Doc PR        | -If you use X-Forwarded-Host but don't provide X-Forwarded-Port, it will default to `0.0.0.0:` which then assumes port `0` instead of following its default assumption based on the scheme.Commits-------adcdd93 PHP 5 compat6c49a0c Add test casec266d6c Update Request.php23db9be Don't assume port 0 for X-Forwarded-Port
@alexbowersalexbowers deleted the patch-2 branchJuly 8, 2019 23:01
@alexbowers
Copy link
ContributorAuthor

@fabpot any idea when the next release will be?

This was referencedJul 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@xabbuhxabbuhxabbuh approved these changes

+1 more reviewer

@TobionTobionTobion requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

6 participants

@alexbowers@nicolas-grekas@xabbuh@fabpot@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp