diff --git a/falcon/redirects.py b/falcon/redirects.py index 75675b0fe..05471609f 100644 --- a/falcon/redirects.py +++ b/falcon/redirects.py @@ -36,7 +36,7 @@ class HTTPMovedPermanently(HTTPStatus): behavior is undesired, the 308 (Permanent Redirect) status code can be used instead. - (See also: RFC 7231, Section 6.4.2) + (See also: :rfc:`9110`, Section 6.4.2) Args: location (str): URI to provide as the Location header in the @@ -65,7 +65,7 @@ class HTTPFound(HTTPStatus): behavior is undesired, the 307 (Temporary Redirect) status code can be used instead. - (See also: RFC 7231, Section 6.4.3) + (See also: :rfc:`9110`, Section 6.4.3) Args: location (str): URI to provide as the Location header in the @@ -99,7 +99,7 @@ class HTTPSeeOther(HTTPStatus): The new URI in the Location header field is not considered equivalent to the effective request URI. - (See also: RFC 7231, Section 6.4.4) + (See also: :rfc:`9110`, Section 6.4.4) Args: location (str): URI to provide as the Location header in the diff --git a/falcon/request.py b/falcon/request.py index 7985e6079..7bb1a7cae 100644 --- a/falcon/request.py +++ b/falcon/request.py @@ -493,7 +493,7 @@ def if_match(self) -> list[ETag | Literal['*']] | None: header, both strong and weak, in the same order as listed in the header. - (See also: RFC 7232, Section 3.1) + (See also: :rfc:`9110`, Section 8.8.4) """ # noqa: D205 # TODO(kgriffs): It may make sense at some point to create a # header property generator that DRY's up the memoization @@ -517,7 +517,7 @@ def if_none_match(self) -> list[ETag | Literal['*']] | None: header, both strong and weak, in the same order as listed in the header. - (See also: RFC 7232, Section 3.2) + (See also: :rfc:`9110`, Section 8.8.5) """ # noqa: D205 if self._cached_if_none_match is _UNSET: header_value = self.env.get('HTTP_IF_NONE_MATCH') @@ -604,9 +604,9 @@ def range(self) -> tuple[int, int] | None: return first_num, last_num except ValueError: - href = 'https://tools.ietf.org/html/rfc7233' + href = 'https://tools.ietf.org/html/rfc9110' href_text = 'HTTP/1.1 Range Requests' - msg = 'It must be a range formatted according to RFC 7233.' + msg = 'It must be a range formatted according to RFC 9110.' raise errors.HTTPInvalidHeader(msg, 'Range', href=href, href_text=href_text) @property @@ -1339,7 +1339,7 @@ def get_header_as_datetime( ``HTTPBadRequest`` instead of returning gracefully when the header is not found (default ``False``). obs_date (bool): Support obs-date formats according to - RFC 7231, e.g.: "Sunday, 06-Nov-94 08:49:37 GMT" + RFC 9110, e.g.: "Sunday, 06-Nov-94 08:49:37 GMT" (default ``False``). Returns: @@ -1363,7 +1363,7 @@ def get_header_as_datetime( else: return None except ValueError: - msg = 'It must be formatted according to RFC 7231, Section 7.1.1.1' + msg = 'It must be formatted according to RFC 9110, Section 5.6.7' raise errors.HTTPInvalidHeader(msg, header) def get_cookie_values(self, name: str) -> list[str] | None: diff --git a/falcon/response.py b/falcon/response.py index d28b3c1dc..d8c7c4646 100644 --- a/falcon/response.py +++ b/falcon/response.py @@ -1096,7 +1096,7 @@ def add_link(self) -> NoReturn: case, raising ``falcon.HTTPRangeNotSatisfiable`` will do the right thing. - (See also: RFC 7233, Section 4.2) + (See also: :rfc:`9110`, Section 14.4) """, _format_range, ) @@ -1114,7 +1114,7 @@ def add_link(self) -> NoReturn: case, raising ``falcon.HTTPRangeNotSatisfiable`` will do the right thing. - (See also: RFC 7233, Section 4.2) + (See also: :rfc:`9110`, Section 14.4) """ content_type: str | None = _header_property( @@ -1290,7 +1290,7 @@ def add_link(self) -> NoReturn: value consists of either a single asterisk ("*") or a list of header field names (case-insensitive). - (See also: RFC 7231, Section 7.1.4) + (See also: :rfc:`9110`, Section 7.1.4) """, _format_header_value_list, ) @@ -1307,7 +1307,7 @@ def add_link(self) -> NoReturn: value consists of either a single asterisk ("*") or a list of header field names (case-insensitive). - (See also: RFC 7231, Section 7.1.4) + (See also: :rfc:`9110`, Section 7.1.4) """ accept_ranges: str | None = _header_property( diff --git a/falcon/testing/client.py b/falcon/testing/client.py index 05b0874d1..801efc84b 100644 --- a/falcon/testing/client.py +++ b/falcon/testing/client.py @@ -550,7 +550,7 @@ def simulate_request( for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -813,7 +813,7 @@ async def _simulate_request_asgi( for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -1355,7 +1355,7 @@ def simulate_get(app: Callable[..., Any], path: str, **kwargs: Any) -> Result: for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -1458,7 +1458,7 @@ def simulate_head(app: Callable[..., Any], path: str, **kwargs: Any) -> Result: for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -1556,7 +1556,7 @@ def simulate_post(app: Callable[..., Any], path: str, **kwargs: Any) -> Result: for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -1667,7 +1667,7 @@ def simulate_put(app: Callable[..., Any], path: str, **kwargs: Any) -> Result: for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -1773,7 +1773,7 @@ def simulate_options(app: Callable[..., Any], path: str, **kwargs: Any) -> Resul for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -1867,7 +1867,7 @@ def simulate_patch(app: Callable[..., Any], path: str, **kwargs: Any) -> Result: for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: @@ -1973,7 +1973,7 @@ def simulate_delete(app: Callable[..., Any], path: str, **kwargs: Any) -> Result for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: diff --git a/falcon/testing/helpers.py b/falcon/testing/helpers.py index a3ad9eb13..93a85f695 100644 --- a/falcon/testing/helpers.py +++ b/falcon/testing/helpers.py @@ -926,7 +926,7 @@ def create_scope( for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). When the + format (see also :rfc:`9112` and :rfc:`9110`). When the request will include a body, the Content-Length header should be included in this list. Header names are not case-sensitive. @@ -1069,7 +1069,7 @@ def create_scope_ws( for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). When the + format (see also :rfc:`9112` and :rfc:`9110`). When the request will include a body, the Content-Length header should be included in this list. Header names are not case-sensitive. @@ -1166,7 +1166,7 @@ def create_environ( for an HTTP header. If desired, multiple header values may be combined into a single (*name*, *value*) pair by joining the values with a comma when the header in question supports the list - format (see also RFC 7230 and RFC 7231). Header names are not + format (see also :rfc:`9112` and :rfc:`9110`). Header names are not case-sensitive. Note: diff --git a/falcon/util/misc.py b/falcon/util/misc.py index 8422ff19c..a1981d448 100644 --- a/falcon/util/misc.py +++ b/falcon/util/misc.py @@ -166,7 +166,7 @@ def http_date_to_dt(http_date: str, obs_date: bool = False) -> datetime.datetime Keyword Arguments: obs_date (bool): Support obs-date formats according to - RFC 7231, e.g.: + RFC 9110, e.g.: "Sunday, 06-Nov-94 08:49:37 GMT" (default ``False``). Returns: diff --git a/falcon/util/structures.py b/falcon/util/structures.py index 78e95d39c..af199da9d 100644 --- a/falcon/util/structures.py +++ b/falcon/util/structures.py @@ -237,7 +237,7 @@ class ETag(str): This class is simply a subclass of ``str`` with a few helper methods and an extra attribute to indicate whether the entity-tag is weak or strong. The - value of the string is equivalent to what RFC 7232 calls an "opaque-tag", + value of the string is equivalent to what RFC 9110 calls an "opaque-tag", i.e. an entity-tag sans quotes and the weakness indicator. Note: @@ -261,7 +261,7 @@ def on_get(self, req, resp): resp.etag = content_etag resp.status = falcon.HTTP_200 - (See also: RFC 7232) + (See also: :rfc:`9110`) """ is_weak: bool = False @@ -273,7 +273,7 @@ def strong_compare(self, other: ETag) -> bool: Two entity-tags are equivalent if both are not weak and their opaque-tags match character-by-character. - (See also: RFC 7232, Section 2.3.2) + (See also: :rfc:`9110`, Section 8.8.3.2) Arguments: other (ETag): The other :class:`~.ETag` to which you are comparing @@ -289,7 +289,7 @@ def strong_compare(self, other: ETag) -> bool: def dumps(self) -> str: """Serialize the ETag to a string suitable for use in a precondition header. - (See also: RFC 7232, Section 2.3) + (See also: :rfc:`9110`, Section 8.8.3) Returns: str: An opaque quoted string, possibly prefixed by a weakness @@ -313,11 +313,11 @@ def loads(cls, etag_str: str) -> ETag: entity-tag. It can not be used to parse a comma-separated list of values. - (See also: RFC 7232, Section 2.3) + (See also: :rfc:`9110`, Section 8.8.3) Arguments: etag_str (str): An ASCII string representing a single entity-tag, - as defined by RFC 7232. + as defined by RFC 9110. Returns: ETag: An instance of `~.ETag` representing the parsed entity-tag.