Skip to content

Commit

Permalink
Don't set the default port when the Host header exists
Browse files Browse the repository at this point in the history
If there is a Host header, then we can expect the port to be part of it.
If the port is not there, then we should use the default for the scheme
as per RFC 2616, section 14.23.
  • Loading branch information
akrabat committed Sep 11, 2018
1 parent 1ee987a commit 8b7a445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Slim/Http/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static function createFromEnvironment(Environment $env)
if ($env->has('HTTP_HOST')) {
$host = $env->get('HTTP_HOST');
// set a port default
$port = 80;
$port = null;
} else {
$host = $env->get('SERVER_NAME');
// set a port default
Expand Down

0 comments on commit 8b7a445

Please sign in to comment.