summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/psr7/src/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/src/functions.php')
-rw-r--r--server/vendor/guzzlehttp/psr7/src/functions.php8
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'];
}