Skip to content
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

RequestFactory: when proxy is used, sets default port when HTTP_X_FORWARDED_PORT is not available #124

Closed
wants to merge 1 commit into from

Conversation

@dg
Copy link
Member

dg commented Jun 13, 2017

  • bug fix? yes
  • new feature? no
  • BC break? no

This should prevent to create links like https://example.com:80

…WARDED_PORT is not available
@dg

This comment has been minimized.

Copy link
Member Author

dg commented Jun 13, 2017

@grongor can you help me to add test to RequestFactory.scheme.phpt?

@grongor

This comment has been minimized.

Copy link
Contributor

grongor commented Jun 13, 2017

@dg I hope this is what you expected :) dg#1 It should do the job ...

@dg

This comment has been minimized.

Copy link
Member Author

dg commented Jun 13, 2017

@grongor thanks!

@dg dg closed this in 08df9ae Jun 13, 2017
dg added a commit that referenced this pull request Jun 13, 2017
…vailable, uses default port [Closes #124]

thanks to @grongor for test
@@ -238,6 +238,7 @@ public function createHttpRequest(): Request
} else {
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$url->setScheme(strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0 ? 'https' : 'http');
$url->setPort($url->getScheme() === 'https' ? 443 : 80);

This comment has been minimized.

Copy link
@f3l1x

f3l1x Jun 14, 2017

Member

Wow, it's great, I can remove theses lines.

DeprecatedPackages/componette-dockerfiles@10a4511

grongor referenced this pull request Jun 14, 2017
Also added SERVER_NAME in order to prevent port being based on the scheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.