Server geändert
This commit is contained in:
@ -3,8 +3,8 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [Unreleased]
|
||||
@ -117,7 +117,7 @@ Several other fixes and improvements.
|
||||
doing some magic.
|
||||
- `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception
|
||||
because the path of a URI with an authority must start with a slash "/" or be empty
|
||||
- `(new Uri())->withScheme('http')` will return `'http://localhost'`
|
||||
- `(new Uri())->withScheme('http')` will return `'https://localhost'`
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# PSR-7 Message Implementation
|
||||
|
||||
This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/)
|
||||
This repository contains a full [PSR-7](https://www.php-fig.org/psr/psr-7/)
|
||||
message implementation, several stream decorators, and some helpful
|
||||
functionality like query string parsing.
|
||||
|
||||
@ -65,7 +65,7 @@ then on disk.
|
||||
```php
|
||||
use GuzzleHttp\Psr7;
|
||||
|
||||
$original = Psr7\stream_for(fopen('http://www.google.com', 'r'));
|
||||
$original = Psr7\stream_for(fopen('https://www.google.com', 'r'));
|
||||
$stream = new Psr7\CachingStream($original);
|
||||
|
||||
$stream->read(1024);
|
||||
@ -315,7 +315,7 @@ There are various functions available under the `GuzzleHttp\Psr7` namespace.
|
||||
Returns the string representation of an HTTP message.
|
||||
|
||||
```php
|
||||
$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
|
||||
$request = new GuzzleHttp\Psr7\Request('GET', 'https://example.com');
|
||||
echo GuzzleHttp\Psr7\str($request);
|
||||
```
|
||||
|
||||
@ -329,7 +329,7 @@ UriInterface for the given value. If the value is already a `UriInterface`, it
|
||||
is returned as-is.
|
||||
|
||||
```php
|
||||
$uri = GuzzleHttp\Psr7\uri_for('http://example.com');
|
||||
$uri = GuzzleHttp\Psr7\uri_for('https://example.com');
|
||||
assert($uri === GuzzleHttp\Psr7\uri_for($uri));
|
||||
```
|
||||
|
||||
@ -595,7 +595,7 @@ manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__to
|
||||
|
||||
`public static function fromParts(array $parts): UriInterface`
|
||||
|
||||
Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components.
|
||||
Creates a URI from a hash of [`parse_url`](https://php.net/manual/en/function.parse-url.php) components.
|
||||
|
||||
|
||||
### `GuzzleHttp\Psr7\Uri::withQueryValue`
|
||||
@ -653,11 +653,11 @@ One use-case is to use the current request URI as base URI and then generate rel
|
||||
to reduce the document size or offer self-contained downloadable document archives.
|
||||
|
||||
```php
|
||||
$base = new Uri('http://example.com/a/b/');
|
||||
echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'.
|
||||
echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'.
|
||||
echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'.
|
||||
echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'.
|
||||
$base = new Uri('https://example.com/a/b/');
|
||||
echo UriResolver::relativize($base, new Uri('https://example.com/a/b/c')); // prints 'c'.
|
||||
echo UriResolver::relativize($base, new Uri('https://example.com/a/x/y')); // prints '../x/y'.
|
||||
echo UriResolver::relativize($base, new Uri('https://example.com/a/b/?q')); // prints '?q'.
|
||||
echo UriResolver::relativize($base, new Uri('https://example.org/a/b/')); // prints '//example.org/a/b/'.
|
||||
```
|
||||
|
||||
## Normalization and Comparison
|
||||
@ -681,7 +681,7 @@ of normalizations to apply. The following normalizations are available:
|
||||
|
||||
All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized.
|
||||
|
||||
Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b`
|
||||
Example: `https://example.org/a%c2%b1b` → `https://example.org/a%C2%B1b`
|
||||
|
||||
- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS`
|
||||
|
||||
@ -690,13 +690,13 @@ of normalizations to apply. The following normalizations are available:
|
||||
not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved
|
||||
characters by URI normalizers.
|
||||
|
||||
Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/`
|
||||
Example: `https://example.org/%7Eusern%61me/` → `https://example.org/~username/`
|
||||
|
||||
- `UriNormalizer::CONVERT_EMPTY_PATH`
|
||||
|
||||
Converts the empty path to "/" for http and https URIs.
|
||||
|
||||
Example: `http://example.org` → `http://example.org/`
|
||||
Example: `https://example.org` → `https://example.org/`
|
||||
|
||||
- `UriNormalizer::REMOVE_DEFAULT_HOST`
|
||||
|
||||
@ -710,14 +710,14 @@ of normalizations to apply. The following normalizations are available:
|
||||
|
||||
Removes the default port of the given URI scheme from the URI.
|
||||
|
||||
Example: `http://example.org:80/` → `http://example.org/`
|
||||
Example: `https://example.org:80/` → `https://example.org/`
|
||||
|
||||
- `UriNormalizer::REMOVE_DOT_SEGMENTS`
|
||||
|
||||
Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would
|
||||
change the semantics of the URI reference.
|
||||
|
||||
Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html`
|
||||
Example: `https://example.org/../a/b/../c/./d.html` → `https://example.org/a/c/d.html`
|
||||
|
||||
- `UriNormalizer::REMOVE_DUPLICATE_SLASHES`
|
||||
|
||||
@ -725,7 +725,7 @@ of normalizations to apply. The following normalizations are available:
|
||||
and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization
|
||||
may change the semantics. Encoded slashes (%2F) are not removed.
|
||||
|
||||
Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html`
|
||||
Example: `https://example.org//foo///bar.html` → `https://example.org/foo/bar.html`
|
||||
|
||||
- `UriNormalizer::SORT_QUERY_PARAMETERS`
|
||||
|
||||
|
@ -11,8 +11,8 @@ use Psr\Http\Message\StreamInterface;
|
||||
* then appends the zlib.inflate filter. The stream is then converted back
|
||||
* to a Guzzle stream resource to be used as a Guzzle stream.
|
||||
*
|
||||
* @link http://tools.ietf.org/html/rfc1952
|
||||
* @link http://php.net/manual/en/filters.compression.php
|
||||
* @link https://tools.ietf.org/html/rfc1952
|
||||
* @link https://php.net/manual/en/filters.compression.php
|
||||
*/
|
||||
class InflateStream implements StreamInterface
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ class Request implements RequestInterface
|
||||
$this->headerNames['host'] = 'Host';
|
||||
}
|
||||
// Ensure Host is the first header.
|
||||
// See: http://tools.ietf.org/html/rfc7230#section-5.4
|
||||
// See: https://tools.ietf.org/html/rfc7230#section-5.4
|
||||
$this->headers = [$header => [$host]] + $this->headers;
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
||||
|
||||
private static function extractHostAndPortFromAuthority($authority)
|
||||
{
|
||||
$uri = 'http://'.$authority;
|
||||
$uri = 'https://'.$authority;
|
||||
$parts = parse_url($uri);
|
||||
if (false === $parts) {
|
||||
return [null, null];
|
||||
|
@ -15,8 +15,8 @@ class Stream implements StreamInterface
|
||||
*
|
||||
* @var string
|
||||
*
|
||||
* @see http://php.net/manual/function.fopen.php
|
||||
* @see http://php.net/manual/en/function.gzopen.php
|
||||
* @see https://php.net/manual/function.fopen.php
|
||||
* @see https://php.net/manual/en/function.gzopen.php
|
||||
*/
|
||||
const READABLE_MODES = '/r|a\+|ab\+|w\+|wb\+|x\+|xb\+|c\+|cb\+/';
|
||||
const WRITABLE_MODES = '/a|w|r\+|rb\+|rw|x|c/';
|
||||
|
@ -236,8 +236,8 @@ class UploadedFile implements UploadedFileInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see http://php.net/is_uploaded_file
|
||||
* @see http://php.net/move_uploaded_file
|
||||
* @see https://php.net/is_uploaded_file
|
||||
* @see https://php.net/move_uploaded_file
|
||||
* @param string $targetPath Path to which to move the uploaded file.
|
||||
* @throws RuntimeException if the upload was not successful.
|
||||
* @throws InvalidArgumentException if the $path specified is invalid.
|
||||
@ -287,7 +287,7 @@ class UploadedFile implements UploadedFileInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see http://php.net/manual/en/features.file-upload.errors.php
|
||||
* @see https://php.net/manual/en/features.file-upload.errors.php
|
||||
* @return int One of PHP's UPLOAD_ERR_XXX constants.
|
||||
*/
|
||||
public function getError()
|
||||
|
@ -357,7 +357,7 @@ class Uri implements UriInterface
|
||||
* @param array $parts
|
||||
*
|
||||
* @return UriInterface
|
||||
* @link http://php.net/manual/en/function.parse-url.php
|
||||
* @link https://php.net/manual/en/function.parse-url.php
|
||||
*
|
||||
* @throws \InvalidArgumentException If the components do not form a valid URI.
|
||||
*/
|
||||
|
@ -23,7 +23,7 @@ final class UriNormalizer
|
||||
/**
|
||||
* All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized.
|
||||
*
|
||||
* Example: http://example.org/a%c2%b1b → http://example.org/a%C2%B1b
|
||||
* Example: https://example.org/a%c2%b1b → https://example.org/a%C2%B1b
|
||||
*/
|
||||
const CAPITALIZE_PERCENT_ENCODING = 1;
|
||||
|
||||
@ -34,14 +34,14 @@ final class UriNormalizer
|
||||
* hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should not be created by URI producers and,
|
||||
* when found in a URI, should be decoded to their corresponding unreserved characters by URI normalizers.
|
||||
*
|
||||
* Example: http://example.org/%7Eusern%61me/ → http://example.org/~username/
|
||||
* Example: https://example.org/%7Eusern%61me/ → https://example.org/~username/
|
||||
*/
|
||||
const DECODE_UNRESERVED_CHARACTERS = 2;
|
||||
|
||||
/**
|
||||
* Converts the empty path to "/" for http and https URIs.
|
||||
*
|
||||
* Example: http://example.org → http://example.org/
|
||||
* Example: https://example.org → https://example.org/
|
||||
*/
|
||||
const CONVERT_EMPTY_PATH = 4;
|
||||
|
||||
@ -61,7 +61,7 @@ final class UriNormalizer
|
||||
/**
|
||||
* Removes the default port of the given URI scheme from the URI.
|
||||
*
|
||||
* Example: http://example.org:80/ → http://example.org/
|
||||
* Example: https://example.org:80/ → https://example.org/
|
||||
*/
|
||||
const REMOVE_DEFAULT_PORT = 16;
|
||||
|
||||
@ -71,7 +71,7 @@ final class UriNormalizer
|
||||
* Dot-segments in relative-path references are not removed as it would
|
||||
* change the semantics of the URI reference.
|
||||
*
|
||||
* Example: http://example.org/../a/b/../c/./d.html → http://example.org/a/c/d.html
|
||||
* Example: https://example.org/../a/b/../c/./d.html → https://example.org/a/c/d.html
|
||||
*/
|
||||
const REMOVE_DOT_SEGMENTS = 32;
|
||||
|
||||
@ -82,7 +82,7 @@ final class UriNormalizer
|
||||
* But in theory those URIs do not need to be equivalent. So this normalization
|
||||
* may change the semantics. Encoded slashes (%2F) are not removed.
|
||||
*
|
||||
* Example: http://example.org//foo///bar.html → http://example.org/foo/bar.html
|
||||
* Example: https://example.org//foo///bar.html → https://example.org/foo/bar.html
|
||||
*/
|
||||
const REMOVE_DUPLICATE_SLASHES = 64;
|
||||
|
||||
|
@ -18,7 +18,7 @@ final class UriResolver
|
||||
* @param string $path
|
||||
*
|
||||
* @return string
|
||||
* @link http://tools.ietf.org/html/rfc3986#section-5.2.4
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-5.2.4
|
||||
*/
|
||||
public static function removeDotSegments($path)
|
||||
{
|
||||
@ -57,7 +57,7 @@ final class UriResolver
|
||||
* @param UriInterface $rel Relative URI
|
||||
*
|
||||
* @return UriInterface
|
||||
* @link http://tools.ietf.org/html/rfc3986#section-5.2
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-5.2
|
||||
*/
|
||||
public static function resolve(UriInterface $base, UriInterface $rel)
|
||||
{
|
||||
@ -118,11 +118,11 @@ final class UriResolver
|
||||
* One use-case is to use the current request URI as base URI and then generate relative links in your documents
|
||||
* to reduce the document size or offer self-contained downloadable document archives.
|
||||
*
|
||||
* $base = new Uri('http://example.com/a/b/');
|
||||
* echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'.
|
||||
* echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'.
|
||||
* echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'.
|
||||
* echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'.
|
||||
* $base = new Uri('https://example.com/a/b/');
|
||||
* echo UriResolver::relativize($base, new Uri('https://example.com/a/b/c')); // prints 'c'.
|
||||
* echo UriResolver::relativize($base, new Uri('https://example.com/a/x/y')); // prints '../x/y'.
|
||||
* echo UriResolver::relativize($base, new Uri('https://example.com/a/b/?q')); // prints '?q'.
|
||||
* echo UriResolver::relativize($base, new Uri('https://example.org/a/b/')); // prints '//example.org/a/b/'.
|
||||
*
|
||||
* This method also accepts a target that is already relative and will try to relativize it further. Only a
|
||||
* relative-path reference will be returned as-is.
|
||||
|
@ -632,7 +632,7 @@ function mimetype_from_filename($filename)
|
||||
* @param $extension string The file extension.
|
||||
*
|
||||
* @return string|null
|
||||
* @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
|
||||
* @link https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
|
||||
*/
|
||||
function mimetype_from_extension($extension)
|
||||
{
|
||||
|
Reference in New Issue
Block a user