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] Move handling of conflicting origin IPs to catch block#19233

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 2 commits intosymfony:2.7fromnicolas-grekas:catch-proxy
Jun 30, 2016

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedJun 29, 2016
edited
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#19217
LicenseMIT
Doc PR-

@nicolas-grekasnicolas-grekas changed the titleCatch proxy[HttpKernel] Move conflicting origin IPs handling to catch blockJun 29, 2016
<tagname="kernel.event_subscriber" />
</service>

<serviceid="validate_request_listener"class="Symfony\Component\HttpKernel\EventListener\RequestListener">
Copy link
Contributor

@HeahDudeHeahDudeJun 29, 2016
edited
Loading

Choose a reason for hiding this comment

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

You should also change the id accordingly to the class name, is that a possible BC break?

Copy link
Member

Choose a reason for hiding this comment

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

Not really, asrequest_listener can easily conflict with an existing service. But having a disconnect between the class name and the id is strange.

HeahDude reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest, whatever the id is, to add it to the changelog.

@nicolas-grekasnicolas-grekasforce-pushed thecatch-proxy branch 3 times, most recently fromc9fee33 to65db9ecCompareJune 29, 2016 18:45
try {
return$this->handleRaw($request,$type);
}catch (\Exception$e) {
if ($einstanceof ConflictingHeadersException) {
Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasJun 29, 2016
edited
Loading

Choose a reason for hiding this comment

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

To me, this belongs to HttpKernel: it's a low level HttpFoundation exception (the only one), and HttpKernel job's is to map HttpFoundation to event's world, and deal with any kind of events, exceptions included. It's HttpKernel's responsibility to convert HttpFoundation exceptions to HttpKernel's world.
It's not optional at all, and existing HttpKernel users (e.g. Drupal) need to get a BadRequestHttpException that they already know how do deal with. Not this ConflictingHeadersException that comes from lower levels.

The listener below is a nice to have, that adds an early check in the request management process. Totally optional and a smooth feature for the FrameworkBundle.

Thus the split I made here.
That's only my humble opinion and maybe I miss the thing, so I'll move to the listener if you're sure it's the right place.

Copy link
Member

Choose a reason for hiding this comment

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

That's indeed much better now. 👍

@nicolas-grekasnicolas-grekas changed the title[HttpKernel] Move conflicting origin IPs handling to catch block[HttpKernel] Move handling of conflicting origin IPs to catch blockJun 30, 2016
}

file_put_contents('packages.json',json_encode(compact('packages'),$flags));
file_put_contents(dirname(__DIR__).'/packages.json',json_encode(compact('packages'),$flags));
Copy link
Member

Choose a reason for hiding this comment

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

these changes seems unrelated

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

yep, I'm debugging travis right now, this PR triggers situations that are not handled correctly today, please don't merge until it's green. I'll post a notice here.

@nicolas-grekasnicolas-grekasforce-pushed thecatch-proxy branch 5 times, most recently frome1bc96d todb84101CompareJune 30, 2016 09:16
@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commitdb84101 intosymfony:2.7Jun 30, 2016
fabpot added a commit that referenced this pull requestJun 30, 2016
…catch block (magnusnordlander, nicolas-grekas)This PR was merged into the 2.7 branch.Discussion----------[HttpKernel] Move handling of conflicting origin IPs to catch block| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19217| License       | MIT| Doc PR        | -Commits-------db84101 [HttpKernel] Add listener that checks when request has both Forwarded and X-Forwarded-For1f00b55 [HttpKernel] Move conflicting origin IPs handling to catch block
@nicolas-grekasnicolas-grekas deleted the catch-proxy branchJune 30, 2016 09:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@fabpot@HeahDude@carsonbot@magnusnordlander

[8]ページ先頭

©2009-2025 Movatter.jp