diff --git a/httpx/_client.py b/httpx/_client.py index 13cd933673..4105f2709a 100644 --- a/httpx/_client.py +++ b/httpx/_client.py @@ -498,7 +498,7 @@ def _redirect_method(self, request: Request, response: Response) -> str: """ method = request.method - # https://tools.ietf.org/html/rfc7231#section-6.4.4 + # https://tools.ietf.org/html/rfc9110#section-15.4.4 if response.status_code == codes.SEE_OTHER and method != "HEAD": method = "GET" @@ -532,12 +532,12 @@ def _redirect_url(self, request: Request, response: Response) -> URL: if url.scheme and not url.host: url = url.copy_with(host=request.url.host) - # Facilitate relative 'Location' headers, as allowed by RFC 7231. + # Facilitate relative 'Location' headers, as allowed by RFC 9110. # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource') if url.is_relative_url: url = request.url.join(url) - # Attach previous fragment if needed (RFC 7231 7.1.2) + # Attach previous fragment if needed (RFC 9110 10.2.2) if request.url.fragment and not url.fragment: url = url.copy_with(fragment=request.url.fragment) diff --git a/httpx/_models.py b/httpx/_models.py index 2cc86321a4..926d16b221 100644 --- a/httpx/_models.py +++ b/httpx/_models.py @@ -286,7 +286,7 @@ def __getitem__(self, key: str) -> str: Return a single header value. If there are multiple headers with the same key, then we concatenate - them with commas. See: https://tools.ietf.org/html/rfc7230#section-3.2.2 + them with commas. See: https://tools.ietf.org/html/rfc9110#section-5.3 """ normalized_key = key.lower().encode(self.encoding) diff --git a/httpx/_urlparse.py b/httpx/_urlparse.py index bf190fd560..1ad24a8423 100644 --- a/httpx/_urlparse.py +++ b/httpx/_urlparse.py @@ -367,7 +367,7 @@ def encode_host(host: str) -> str: # From https://datatracker.ietf.org/doc/html/rfc3986/#section-3.2.2 # # "A host identified by an Internet Protocol literal address, version 6 - # [RFC3513] or later, is distinguished by enclosing the IP literal + # [RFC4291] or later, is distinguished by enclosing the IP literal # within square brackets ("[" and "]"). This is the only place where # square bracket characters are allowed in the URI syntax." try: