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 | |
| parent | 5f34f504b08b34aad35d232d3ea35f2b4b70b070 (diff) | |
| parent | 81d5c2a6464771c9a180d0214706a2f65f0b1d18 (diff) | |
Merge branch 'master' into Eole
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/src')
| -rw-r--r-- | server/vendor/guzzlehttp/psr7/src/MultipartStream.php | 4 | ||||
| -rw-r--r-- | server/vendor/guzzlehttp/psr7/src/Response.php | 1 | ||||
| -rw-r--r-- | server/vendor/guzzlehttp/psr7/src/Uri.php | 17 | ||||
| -rw-r--r-- | server/vendor/guzzlehttp/psr7/src/functions.php | 8 |
4 files changed, 23 insertions, 7 deletions
diff --git a/server/vendor/guzzlehttp/psr7/src/MultipartStream.php b/server/vendor/guzzlehttp/psr7/src/MultipartStream.php index fd006ec..2988fcb 100644 --- a/server/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/server/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -113,7 +113,7 @@ class MultipartStream implements StreamInterface // Set a default content-disposition header if one was no provided $disposition = $this->getHeader($headers, 'content-disposition'); if (!$disposition) { - $headers['Content-Disposition'] = $filename + $headers['Content-Disposition'] = ($filename === '0' || $filename) ? sprintf('form-data; name="%s"; filename="%s"', $name, basename($filename)) @@ -130,7 +130,7 @@ class MultipartStream implements StreamInterface // Set a default Content-Type if one was not supplied $type = $this->getHeader($headers, 'content-type'); - if (!$type && $filename) { + if (!$type && ($filename === '0' || $filename)) { if ($type = mimetype_from_filename($filename)) { $headers['Content-Type'] = $type; } diff --git a/server/vendor/guzzlehttp/psr7/src/Response.php b/server/vendor/guzzlehttp/psr7/src/Response.php index c94bf8f..58c4c6a 100644 --- a/server/vendor/guzzlehttp/psr7/src/Response.php +++ b/server/vendor/guzzlehttp/psr7/src/Response.php @@ -59,6 +59,7 @@ class Response implements ResponseInterface 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', diff --git a/server/vendor/guzzlehttp/psr7/src/Uri.php b/server/vendor/guzzlehttp/psr7/src/Uri.php index d428f2e..23fa2a4 100644 --- a/server/vendor/guzzlehttp/psr7/src/Uri.php +++ b/server/vendor/guzzlehttp/psr7/src/Uri.php @@ -477,21 +477,28 @@ class Uri implements UriInterface $uri = ''; if (!empty($scheme)) { - $uri .= $scheme . '://'; + $uri .= $scheme . ':'; } + $hierPart = ''; + if (!empty($authority)) { - $uri .= $authority; + if (!empty($scheme)) { + $hierPart .= '//'; + } + $hierPart .= $authority; } if ($path != null) { // Add a leading slash if necessary. - if ($uri && substr($path, 0, 1) !== '/') { - $uri .= '/'; + if ($hierPart && substr($path, 0, 1) !== '/') { + $hierPart .= '/'; } - $uri .= $path; + $hierPart .= $path; } + $uri .= $hierPart; + if ($query != null) { $uri .= '?' . $query; } 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']; } |
