Skip to content

Commit

Permalink
Replaced all insecure/redirecting links
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Sep 1, 2023
1 parent be45764 commit 2ce93c4
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 36 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ this library also provides additional functionality when working with URIs as st
An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference.
An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI,
the base URI. Relative references can be divided into several forms according to
[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2):
[RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2):

- network-path references, e.g. `//example.com/path`
- absolute-path references, e.g. `/path`
Expand Down Expand Up @@ -696,8 +696,8 @@ or the standard port. This method can be used independently of the implementatio
`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string`

Composes a URI reference string from its various components according to
[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called
manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`.
[RFC 3986 Section 5.3](https://datatracker.ietf.org/doc/html/rfc3986#section-5.3). Usually this method does not need
to be called manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`.

### `GuzzleHttp\Psr7\Uri::fromParts`

Expand Down Expand Up @@ -741,8 +741,8 @@ Determines if a modified URL should be considered cross-origin with respect to a
## Reference Resolution

`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according
to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers
do when resolving a link in a website based on the current request URI.
to [RFC 3986 Section 5](https://datatracker.ietf.org/doc/html/rfc3986#section-5). This is for example also what web
browsers do when resolving a link in a website based on the current request URI.

### `GuzzleHttp\Psr7\UriResolver::resolve`

Expand All @@ -755,7 +755,7 @@ Converts the relative URI into a new URI that is resolved against the base URI.
`public static function removeDotSegments(string $path): string`

Removes dot segments from a path and returns the new path according to
[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4).
[RFC 3986 Section 5.2.4](https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4).

### `GuzzleHttp\Psr7\UriResolver::relativize`

Expand All @@ -781,7 +781,7 @@ echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // pr
## Normalization and Comparison

`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to
[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6).
[RFC 3986 Section 6](https://datatracker.ietf.org/doc/html/rfc3986#section-6).

### `GuzzleHttp\Psr7\UriNormalizer::normalize`

Expand Down
8 changes: 4 additions & 4 deletions src/InflateStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* then appends the zlib.inflate filter. The stream is then converted back
* to a Guzzle stream resource to be used as a Guzzle stream.
*
* @see http://tools.ietf.org/html/rfc1950
* @see http://tools.ietf.org/html/rfc1952
* @see http://php.net/manual/en/filters.compression.php
* @see https://datatracker.ietf.org/doc/html/rfc1950
* @see https://datatracker.ietf.org/doc/html/rfc1952
* @see https://www.php.net/manual/en/filters.compression.php
*/
final class InflateStream implements StreamInterface
{
Expand All @@ -28,7 +28,7 @@ public function __construct(StreamInterface $stream)
{
$resource = StreamWrapper::getResource($stream);
// Specify window=15+32, so zlib will use header detection to both gzip (with header) and zlib data
// See http://www.zlib.net/manual.html#Advanced definition of inflateInit2
// See https://www.zlib.net/manual.html#Advanced definition of inflateInit2
// "Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection"
// Default window size is 15.
stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ, ['window' => 15 + 32]);
Expand Down
8 changes: 4 additions & 4 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static function parseMessage(string $message): array

// If these aren't the same, then one line didn't match and there's an invalid header.
if ($count !== substr_count($rawHeaders, "\n")) {
// Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4
// Folding is deprecated, see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4
if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) {
throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding');
}
Expand Down Expand Up @@ -227,9 +227,9 @@ public static function parseRequest(string $message): RequestInterface
public static function parseResponse(string $message): ResponseInterface
{
$data = self::parseMessage($message);
// According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
// between status-code and reason-phrase is required. But browsers accept
// responses without space and reason as well.
// According to https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2
// the space between status-code and reason-phrase is required. But
// browsers accept responses without space and reason as well.
if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
throw new \InvalidArgumentException('Invalid response string: '.$data['start-line']);
}
Expand Down
6 changes: 3 additions & 3 deletions src/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private function normalizeHeaderValue($value): array
*
* @return string[] Trimmed header values
*
* @see https://tools.ietf.org/html/rfc7230#section-3.2.4
* @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4
*/
private function trimAndValidateHeaderValues(array $values): array
{
Expand All @@ -213,7 +213,7 @@ private function trimAndValidateHeaderValues(array $values): array
}

/**
* @see https://tools.ietf.org/html/rfc7230#section-3.2
* @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2
*
* @param mixed $header
*/
Expand All @@ -234,7 +234,7 @@ private function assertHeader($header): void
}

/**
* @see https://tools.ietf.org/html/rfc7230#section-3.2
* @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2
*
* field-value = *( field-content / obs-fold )
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
Expand Down
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private function updateHostFromUri(): void
$this->headerNames['host'] = 'Host';
}
// Ensure Host is the first header.
// See: http://tools.ietf.org/html/rfc7230#section-5.4
// See: https://datatracker.ietf.org/doc/html/rfc7230#section-5.4
$this->headers = [$header => [$host]] + $this->headers;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
class Stream implements StreamInterface
{
/**
* @see http://php.net/manual/function.fopen.php
* @see http://php.net/manual/en/function.gzopen.php
* @see https://www.php.net/manual/en/function.fopen.php
* @see https://www.php.net/manual/en/function.gzopen.php
*/
private const READABLE_MODES = '/r|a\+|ab\+|w\+|wb\+|x\+|xb\+|c\+|cb\+/';
private const WRITABLE_MODES = '/a|w|r\+|rb\+|rw|x|c/';
Expand Down
18 changes: 9 additions & 9 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class Uri implements UriInterface, \JsonSerializable
/**
* Unreserved characters for use in a regex.
*
* @see https://tools.ietf.org/html/rfc3986#section-2.3
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.3
*/
private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';

/**
* Sub-delims for use in a regex.
*
* @see https://tools.ietf.org/html/rfc3986#section-2.2
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-2.2
*/
private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26'];
Expand Down Expand Up @@ -162,7 +162,7 @@ public function __toString(): string
* `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to
* that format).
*
* @see https://tools.ietf.org/html/rfc3986#section-5.3
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.3
*/
public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string
{
Expand Down Expand Up @@ -219,7 +219,7 @@ public static function isDefaultPort(UriInterface $uri): bool
* @see Uri::isNetworkPathReference
* @see Uri::isAbsolutePathReference
* @see Uri::isRelativePathReference
* @see https://tools.ietf.org/html/rfc3986#section-4
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-4
*/
public static function isAbsolute(UriInterface $uri): bool
{
Expand All @@ -231,7 +231,7 @@ public static function isAbsolute(UriInterface $uri): bool
*
* A relative reference that begins with two slash characters is termed an network-path reference.
*
* @see https://tools.ietf.org/html/rfc3986#section-4.2
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2
*/
public static function isNetworkPathReference(UriInterface $uri): bool
{
Expand All @@ -243,7 +243,7 @@ public static function isNetworkPathReference(UriInterface $uri): bool
*
* A relative reference that begins with a single slash character is termed an absolute-path reference.
*
* @see https://tools.ietf.org/html/rfc3986#section-4.2
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2
*/
public static function isAbsolutePathReference(UriInterface $uri): bool
{
Expand All @@ -258,7 +258,7 @@ public static function isAbsolutePathReference(UriInterface $uri): bool
*
* A relative reference that does not begin with a slash character is termed a relative-path reference.
*
* @see https://tools.ietf.org/html/rfc3986#section-4.2
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2
*/
public static function isRelativePathReference(UriInterface $uri): bool
{
Expand All @@ -277,7 +277,7 @@ public static function isRelativePathReference(UriInterface $uri): bool
* @param UriInterface $uri The URI to check
* @param UriInterface|null $base An optional base URI to compare against
*
* @see https://tools.ietf.org/html/rfc3986#section-4.4
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.4
*/
public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool
{
Expand Down Expand Up @@ -353,7 +353,7 @@ public static function withQueryValues(UriInterface $uri, array $keyValueArray):
/**
* Creates a URI from a hash of `parse_url` components.
*
* @see http://php.net/manual/en/function.parse-url.php
* @see https://www.php.net/manual/en/function.parse-url.php
*
* @throws MalformedUriException If the components do not form a valid URI.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/UriNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @author Tobias Schultze
*
* @see https://tools.ietf.org/html/rfc3986#section-6
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-6
*/
final class UriNormalizer
{
Expand Down Expand Up @@ -119,7 +119,7 @@ final class UriNormalizer
* @param UriInterface $uri The URI to normalize
* @param int $flags A bitmask of normalizations to apply, see constants
*
* @see https://tools.ietf.org/html/rfc3986#section-6.2
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-6.2
*/
public static function normalize(UriInterface $uri, int $flags = self::PRESERVING_NORMALIZATIONS): UriInterface
{
Expand Down Expand Up @@ -174,7 +174,7 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN
* @param UriInterface $uri2 An URI to compare
* @param int $normalizations A bitmask of normalizations to apply, see constants
*
* @see https://tools.ietf.org/html/rfc3986#section-6.1
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-6.1
*/
public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool
{
Expand Down
6 changes: 3 additions & 3 deletions src/UriResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
*
* @author Tobias Schultze
*
* @see https://tools.ietf.org/html/rfc3986#section-5
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-5
*/
final class UriResolver
{
/**
* Removes dot segments from a path and returns the new path.
*
* @see http://tools.ietf.org/html/rfc3986#section-5.2.4
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4
*/
public static function removeDotSegments(string $path): string
{
Expand Down Expand Up @@ -53,7 +53,7 @@ public static function removeDotSegments(string $path): string
/**
* Converts the relative URI into a new URI that is resolved against the base URI.
*
* @see http://tools.ietf.org/html/rfc3986#section-5.2
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2
*/
public static function resolve(UriInterface $base, UriInterface $rel): UriInterface
{
Expand Down

0 comments on commit 2ce93c4

Please sign in to comment.