diff options
| author | josselin <josselin@serverpc.home> | 2016-01-25 22:08:02 +0100 |
|---|---|---|
| committer | josselin <josselin@serverpc.home> | 2016-01-25 22:08:02 +0100 |
| commit | 81d5c2a6464771c9a180d0214706a2f65f0b1d18 (patch) | |
| tree | 3bdc7cb4b721a870eb9bab9696326071b1388ce6 /server/vendor/guzzlehttp/psr7/src/functions.php | |
| parent | eac860ce5092c301068725e5743561c598e924f0 (diff) | |
Added php-opencloud/openstack as SubModule
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']; } |
