diff options
| author | josselin <josselin@serverpc.home> | 2016-01-25 22:12:25 +0100 |
|---|---|---|
| committer | josselin <josselin@serverpc.home> | 2016-01-25 22:12:25 +0100 |
| commit | 793a61475e0045383b23ddb2357a9e632bc8679c (patch) | |
| tree | c641e37cd8ec87e6c6a61a8a27c90f1b21b518f8 /server/vendor/guzzlehttp/psr7/src/functions.php | |
| parent | 5f34f504b08b34aad35d232d3ea35f2b4b70b070 (diff) | |
| parent | 81d5c2a6464771c9a180d0214706a2f65f0b1d18 (diff) | |
Merge branch 'master' into Eole
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']; } |
