diff options
| author | ArnaudVOTA <arnaud.vota@gmail.com> | 2016-01-27 11:04:02 +0100 |
|---|---|---|
| committer | ArnaudVOTA <arnaud.vota@gmail.com> | 2016-01-27 11:04:02 +0100 |
| commit | b10e4679e0f0316bfe24098a84db040dcfc8d38f (patch) | |
| tree | 3bdc7cb4b721a870eb9bab9696326071b1388ce6 /server/vendor/guzzlehttp/psr7/src/functions.php | |
| parent | 5466ce78f00038e742ef2a108c755f57ede451f5 (diff) | |
| parent | 81d5c2a6464771c9a180d0214706a2f65f0b1d18 (diff) | |
Merge remote-tracking branch 'refs/remotes/origin/master' into vota_overlay
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/src/functions.php')
| -rw-r--r-- | server/vendor/guzzlehttp/psr7/src/functions.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/vendor/guzzlehttp/psr7/src/functions.php b/server/vendor/guzzlehttp/psr7/src/functions.php index fd3e7f5..921a5a8 100644 --- a/server/vendor/guzzlehttp/psr7/src/functions.php +++ b/server/vendor/guzzlehttp/psr7/src/functions.php @@ -209,6 +209,14 @@ function modify_request(RequestInterface $request, array $changes) // Remove the host header if one is on the URI if ($host = $changes['uri']->getHost()) { $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':'.$port; + } + } } $uri = $changes['uri']; } |
