diff --git a/docs/source-1.0/spec/aws/aws-json.rst.template b/docs/source-1.0/spec/aws/aws-json.rst.template index ed874431291..64197047214 100644 --- a/docs/source-1.0/spec/aws/aws-json.rst.template +++ b/docs/source-1.0/spec/aws/aws-json.rst.template @@ -50,7 +50,7 @@ The |quoted shape name| protocol uses the following headers: * - ``Content-Length`` - true - The standard ``Content-Length`` header defined by - `RFC 7230 Section 3.3.2`_. + :rfc:`9110#section-8.6`. * - ``X-Amz-Target`` - true for requests - The value of this header is the :token:`shape name ` of the @@ -207,5 +207,3 @@ These compliance tests define a model that is used to define test cases and the expected serialized HTTP requests and responses for each case. *TODO: Add event stream handling specifications.* - -.. _`RFC 7230 Section 3.3.2`: https://tools.ietf.org/html/rfc7230#section-3.3.2 diff --git a/docs/source-1.0/spec/aws/aws-query-serialization.rst.template b/docs/source-1.0/spec/aws/aws-query-serialization.rst.template index 4b11f1fbb8f..fac8711b531 100644 --- a/docs/source-1.0/spec/aws/aws-query-serialization.rst.template +++ b/docs/source-1.0/spec/aws/aws-query-serialization.rst.template @@ -97,5 +97,3 @@ to the input's key. * - ``union`` - A union is serialized identically to a ``structure`` shape, but only a single member can be set to a non-null value. - -.. _`RFC 7230 Section 3.3.2`: https://tools.ietf.org/html/rfc7230#section-3.3.2 diff --git a/docs/source-1.0/spec/core/http-traits.rst b/docs/source-1.0/spec/core/http-traits.rst index 61d2368e99f..2ae3190bfa8 100644 --- a/docs/source-1.0/spec/core/http-traits.rst +++ b/docs/source-1.0/spec/core/http-traits.rst @@ -14,8 +14,8 @@ and error structures are considered when serializing HTTP messages. .. important:: - Violating `HTTP specifications`_ or relying on poorly-supported HTTP - functionality when defining HTTP bindings will limit interoperability + Violating :rfc:`HTTP specifications <9110>` or relying on poorly-supported + HTTP functionality when defining HTTP bindings will limit interoperability and likely lead to undefined behavior across Smithy implementations. For example, avoid defining GET/DELETE requests with payloads, defining response payloads for operations with a 204/205 status, etc. @@ -106,9 +106,8 @@ method The ``method`` property defines the HTTP method of the operation (e.g., "GET", "PUT", "POST", "DELETE", "PATCH", etc). Smithy will use this value literally and will perform no validation on the method. The ``method`` value SHOULD -match the ``operation`` production rule of :rfc:`7230#appendix-B`. This -property does not influence the safety or idempotency characteristics of an -operation. +match one of the definitions found in :rfc:`9110#section-9.3`. This property +does not influence the safety or idempotency characteristics of an operation. .. _http-uri: @@ -117,7 +116,7 @@ uri --- The ``uri`` property defines the *request-target* of the operation in -*origin-form* as defined in :rfc:`7230#section-5.3.1`. The URI is a simple +*origin-form* as defined in :rfc:`9112#section-3.2.1`. The URI is a simple pattern that Smithy uses to match HTTP requests to operations and to bind components of the request URI to fields in the operations's input structure. :dfn:`Patterns` consist of literal characters that MUST be matched in the @@ -525,9 +524,8 @@ Trait selector ``structure`` member that targets a list of these types. Value type ``string`` value defining a valid HTTP header field name according to - :rfc:`section 3.2 of RFC7230 <7230#section-3.2>`. The value MUST NOT be - empty and MUST be case-insensitively unique across all other members of - the structure. + :rfc:`9110#section-5.1`. The value MUST NOT be empty and MUST be + case-insensitively unique across all other members of the structure. Conflicts with :ref:`httpLabel-trait`, :ref:`httpQuery-trait`, @@ -546,7 +544,7 @@ Conflicts with * ``string`` values with a :ref:`mediaType-trait` are always base64 encoded. * ``timestamp`` values are serialized using the ``http-date`` format by default, as defined in the ``IMF-fixdate`` production of - :rfc:`7231#section-7.1.1.1`. The :ref:`timestampFormat-trait` MAY be used + :rfc:`9110#section-5.6.7`. The :ref:`timestampFormat-trait` MAY be used to use a custom serialization format. .. rubric:: Do not put too much data in HTTP headers @@ -954,10 +952,10 @@ the body of the response. .. rubric:: Do not put too much data in the query string -While there is no limit placed on the length of an `HTTP request line`_, -many HTTP client and server implementations enforce limits in practice. -Carefully consider the maximum allowed length of each member that is bound to -an HTTP query string or path. +While there is no limit placed on the length of an +:rfc:`HTTP request line <9112#section-3>`, many HTTP client and server +implementations enforce limits in practice. Carefully consider the maximum +allowed length of each member that is bound to an HTTP query string or path. .. smithy-trait:: smithy.api#httpQueryParams @@ -1335,5 +1333,3 @@ marked with the ``httpPayload`` trait: .. _percent-encoded: https://tools.ietf.org/html/rfc3986#section-2.1 -.. _HTTP request line: https://tools.ietf.org/html/rfc7230.html#section-3.1.1 -.. _HTTP specifications: https://datatracker.ietf.org/doc/html/rfc7230 diff --git a/docs/source-1.0/spec/core/model.rst b/docs/source-1.0/spec/core/model.rst index bd5c4e6ae1e..78f1659dc55 100644 --- a/docs/source-1.0/spec/core/model.rst +++ b/docs/source-1.0/spec/core/model.rst @@ -2020,7 +2020,7 @@ The following example defines the ``PutForecast`` operation. .. rubric:: Put semantics The semantics of a ``put`` lifecycle operation are similar to the semantics -of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC7231] <7231#section-4.3.4>`: +of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC9110] <9110#section-9.3.4>`: The PUT method requests that the state of the target resource be created or replaced ... diff --git a/docs/source-1.0/spec/core/protocol-traits.rst b/docs/source-1.0/spec/core/protocol-traits.rst index e420498b090..61c1af42b56 100644 --- a/docs/source-1.0/spec/core/protocol-traits.rst +++ b/docs/source-1.0/spec/core/protocol-traits.rst @@ -309,7 +309,7 @@ Smithy defines the following built-in timestamp formats: values that contain offsets gracefully by normalizing them to UTC. * - http-date - An HTTP date as defined by the ``IMF-fixdate`` production in - :rfc:`7231#section-7.1.1.1` (for example, + :rfc:`9110#section-5.6.7` (for example, ``Tue, 29 Apr 2014 18:30:38 GMT``). A deserializer that encounters an ``http-date`` timestamp with fractional precision SHOULD fail to deserialize the value (for example, an HTTP server SHOULD return a 400 diff --git a/docs/source-2.0/additional-specs/protocols/smithy-rpc-v2.rst b/docs/source-2.0/additional-specs/protocols/smithy-rpc-v2.rst index 40479383a09..46b54ffa29b 100644 --- a/docs/source-2.0/additional-specs/protocols/smithy-rpc-v2.rst +++ b/docs/source-2.0/additional-specs/protocols/smithy-rpc-v2.rst @@ -238,7 +238,7 @@ headers for requests: is ``application/vnd.amazon.eventstream``. * - ``Content-Length`` - Conditional - - The standard ``Content-Length`` header defined by :rfc:`7230#section-3.3.2`. + - The standard ``Content-Length`` header defined by :rfc:`9110#section-8.6`. For event streaming requests, this MUST NOT be set. * - ``Accept`` - Conditional @@ -303,7 +303,7 @@ headers for responses: is ``application/vnd.amazon.eventstream``. * - ``Content-Length`` - Conditional - - The standard ``Content-Length`` header defined by :rfc:`7230#section-3.3.2`. + - The standard ``Content-Length`` header defined by :rfc:`9110#section-8.6`. For event streaming requests, this SHOULD NOT be set. diff --git a/docs/source-2.0/aws/protocols/aws-json.rst.template b/docs/source-2.0/aws/protocols/aws-json.rst.template index e77914073ad..0e28b73a108 100644 --- a/docs/source-2.0/aws/protocols/aws-json.rst.template +++ b/docs/source-2.0/aws/protocols/aws-json.rst.template @@ -50,7 +50,7 @@ The |quoted shape name| protocol uses the following headers: * - ``Content-Length`` - true - The standard ``Content-Length`` header defined by - :rfc:`7230#section-3.3.2`. + :rfc:`9110#section-8.6`. * - ``X-Amz-Target`` - true for requests - The value of this header is the :token:`shape name ` of the diff --git a/docs/source-2.0/spec/behavior-traits.rst b/docs/source-2.0/spec/behavior-traits.rst index 7ada59fea79..5fdfdb83400 100644 --- a/docs/source-2.0/spec/behavior-traits.rst +++ b/docs/source-2.0/spec/behavior-traits.rst @@ -6,7 +6,7 @@ Idempotency =========== Operations marked with the :ref:`readonly-trait` or :ref:`idempotent-trait` -are considered idempotent as defined in :rfc:`7231#section-4.2.2`. Operations +are considered idempotent as defined in :rfc:`9110#section-9.2.2`. Operations that contain a top-level input member marked with the :ref:`idempotencytoken-trait` that are provided a token for the member are also considered idempotent. All other operations SHOULD be considered unsafe to retry unless the response to diff --git a/docs/source-2.0/spec/http-bindings.rst b/docs/source-2.0/spec/http-bindings.rst index fa00f8de051..b177a54542f 100644 --- a/docs/source-2.0/spec/http-bindings.rst +++ b/docs/source-2.0/spec/http-bindings.rst @@ -14,7 +14,7 @@ and error structures are considered when serializing HTTP messages. .. important:: - Violating :rfc:`HTTP specifications <7230>` or relying on poorly-supported + Violating :rfc:`HTTP specifications <9110>` or relying on poorly-supported HTTP functionality when defining HTTP bindings will limit interoperability and likely lead to undefined behavior across Smithy implementations. For example, avoid defining GET/DELETE requests with payloads, defining @@ -107,9 +107,8 @@ method The ``method`` property defines the HTTP method of the operation (e.g., "GET", "PUT", "POST", "DELETE", "PATCH", etc). Smithy will use this value literally and will perform no validation on the method. The ``method`` value SHOULD -match the ``operation`` production rule of :rfc:`7230#appendix-B`. This -property does not influence the safety or idempotency characteristics of an -operation. +match one of the definitions found in :rfc:`9110#section-9.3`. This property +does not influence the safety or idempotency characteristics of an operation. .. _http-uri: @@ -118,7 +117,7 @@ uri --- The ``uri`` property defines the *request-target* of the operation in -*origin-form* as defined in :rfc:`7230#section-5.3.1`. The URI is a simple +*origin-form* as defined in :rfc:`9112#section-3.2.1`. The URI is a simple pattern that Smithy uses to match HTTP requests to operations and to bind components of the request URI to fields in the operations's input structure. :dfn:`Patterns` consist of literal characters that MUST be matched in the @@ -634,9 +633,8 @@ Trait selector ``structure`` member that targets a list of these types. Value type ``string`` value defining a valid HTTP header field name according to - :rfc:`section 3.2 of RFC7230 <7230#section-3.2>`. The value MUST NOT be - empty and MUST be case-insensitively unique across all other members of - the structure. + :rfc:`9110#section-5.1`. The value MUST NOT be empty and MUST be + case-insensitively unique across all other members of the structure. Conflicts with :ref:`httpLabel-trait`, :ref:`httpQuery-trait`, @@ -656,7 +654,7 @@ Conflicts with * ``string`` values with a :ref:`mediaType-trait` are always base64 encoded. * ``timestamp`` values are serialized using the ``http-date`` format by default, as defined in the ``IMF-fixdate`` production of - :rfc:`7231#section-7.1.1.1`. The :ref:`timestampFormat-trait` MAY be used + :rfc:`9110#section-5.6.7`. The :ref:`timestampFormat-trait` MAY be used to use a custom serialization format. .. note:: @@ -1089,7 +1087,7 @@ is simply ignored. .. note:: While there is no limit placed on the length of an - :rfc:`HTTP request line <7230#section-3.1.1>`, many HTTP client and server + :rfc:`HTTP request line <9112#section-3>`, many HTTP client and server implementations enforce limits in practice. Carefully consider the maximum allowed length of each member that is bound to an HTTP query string or path. diff --git a/docs/source-2.0/spec/protocol-traits.rst b/docs/source-2.0/spec/protocol-traits.rst index 9e93410438c..18f9518ffc9 100644 --- a/docs/source-2.0/spec/protocol-traits.rst +++ b/docs/source-2.0/spec/protocol-traits.rst @@ -228,7 +228,7 @@ Smithy defines the following built-in timestamp formats: values that contain offsets gracefully by normalizing them to UTC. * - http-date - An HTTP date as defined by the ``IMF-fixdate`` production in - :rfc:`7231#section-7.1.1.1` (for example, + :rfc:`9110#section-5.6.7` (for example, ``Tue, 29 Apr 2014 18:30:38 GMT``). A deserializer that encounters an ``http-date`` timestamp with fractional precision SHOULD fail to deserialize the value (for example, an HTTP server SHOULD return a 400 diff --git a/docs/source-2.0/spec/service-types.rst b/docs/source-2.0/spec/service-types.rst index 5ce6ac3d262..c5dd2bcda5b 100644 --- a/docs/source-2.0/spec/service-types.rst +++ b/docs/source-2.0/spec/service-types.rst @@ -862,7 +862,7 @@ Put semantics ^^^^^^^^^^^^^ The semantics of a ``put`` lifecycle operation are similar to the semantics -of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC7231] <7231#section-4.3.4>`: +of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC9110] <9110#section-9.3.4>`: The PUT method requests that the state of the target resource be created or replaced ... diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/pattern/UriPattern.java b/smithy-model/src/main/java/software/amazon/smithy/model/pattern/UriPattern.java index e9847ed2e92..7cc90857c16 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/pattern/UriPattern.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/pattern/UriPattern.java @@ -55,12 +55,12 @@ private UriPattern(Builder builder, Map queryLiterals) { * Parse a URI pattern string into a UriPattern. * *

The provided value must match the origin-form request-target - * grammar production in RFC 7230, section 5.3.1. + * grammar production in RFC 9112, section 3.2.1. * * @param uri URI pattern to parse. * @return Returns the parsed URI pattern. * @throws InvalidUriPatternException for invalid URI patterns. - * @see RFC 7230 Section 5.3.1 + * @see RFC 9112 Section 3.2.1 */ public static UriPattern parse(String uri) { if (uri.endsWith("?")) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/TimestampFormatPlugin.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/TimestampFormatPlugin.java index 8518356cdde..24919cf17b2 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/TimestampFormatPlugin.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/TimestampFormatPlugin.java @@ -126,7 +126,7 @@ private void validateHttpDate(Node value, Emitter emitter) { private String createInvalidHttpDateMessage(String dateValue) { return String.format( "Invalid value provided for %s formatted timestamp. Expected a string value that " - + "matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: %s", + + "matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: %s", TimestampFormatTrait.HTTP_DATE, dateValue); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpHeaderTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpHeaderTraitValidator.java index a438298b1df..45dbff2f265 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpHeaderTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpHeaderTraitValidator.java @@ -39,7 +39,7 @@ */ public final class HttpHeaderTraitValidator extends AbstractValidator { - /** Gather the allowed characters for HTTP headers (tchar from RFC 7230). **/ + /** Gather the allowed characters for HTTP headers (tchar from RFC 9110 section 5.6.2). **/ private static final Set TCHAR = SetUtils.of( // "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~', @@ -101,7 +101,7 @@ private Optional validateHeader(MemberShape member, HttpHeaderT for (int i = 0; i < header.length(); i++) { if (!TCHAR.contains(header.charAt(i))) { return Optional.of(danger(member, trait, String.format( - "`%s` is not a valid HTTP header field name according to section 3.2 of RFC 7230", header))); + "`%s` is not a valid HTTP header field name according to section 5.6.2 of RFC 9110", header))); } } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java index 69f38b38308..42f660a06e0 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java @@ -35,7 +35,7 @@ /** * Validates that `http` traits applied to operation shapes use the most - * semantically appropriate HTTP method according to RFC 7231. + * semantically appropriate HTTP method according to RFC 9110. */ public final class HttpMethodSemanticsValidator extends AbstractValidator { /** diff --git a/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy b/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy index abce5303e55..b8a92aff775 100644 --- a/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy +++ b/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy @@ -1123,7 +1123,7 @@ enum timestampFormat { EPOCH_SECONDS = "epoch-seconds" /// An HTTP date as defined by the IMF-fixdate production in - /// RFC 7231#section-7.1.1.1 (for example, Tue, 29 Apr 2014 18:30:38 GMT). + /// RFC 9110#section-5.6.7 (for example, Tue, 29 Apr 2014 18:30:38 GMT). HTTP_DATE = "http-date" } diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java index 0912847032c..779a5f7b3c9 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/validation/NodeValidationVisitorTest.java @@ -246,9 +246,9 @@ public static Collection data() { // http-date {"ns.foo#HttpDate", "\"Tue, 29 Apr 2014 18:30:38 GMT\"", null}, - {"ns.foo#HttpDate", "\"Tuesday, 29 April 2014 18:30:38 GMT\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: Tuesday, 29 April 2014 18:30:38 GMT"}}, - {"ns.foo#HttpDate", "\"Tue, 29 Apr 2014 18:30:38 PST\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: Tue, 29 Apr 2014 18:30:38 PST"}}, - {"ns.foo#HttpDate", "11", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: number"}}, + {"ns.foo#HttpDate", "\"Tuesday, 29 April 2014 18:30:38 GMT\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: Tuesday, 29 April 2014 18:30:38 GMT"}}, + {"ns.foo#HttpDate", "\"Tue, 29 Apr 2014 18:30:38 PST\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: Tue, 29 Apr 2014 18:30:38 PST"}}, + {"ns.foo#HttpDate", "11", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: number"}}, // date-time {"ns.foo#DateTime", "\"1985-04-12T23:20:50.52Z\"", null}, @@ -267,8 +267,8 @@ public static Collection data() { "0: Invalid string value, `1985-04-12T23:20:50.52-07:00`, provided for timestamp, `ns.foo#TimestampList$member`. Expected an RFC 3339 formatted timestamp (e.g., \"1985-04-12T23:20:50.52Z\")" }}, {"ns.foo#TimestampList", "[123]", new String[] {"0: Expected a string value for a date-time timestamp (e.g., \"1985-04-12T23:20:50.52Z\")"}}, - {"ns.foo#Structure4", "{\"httpDate\": 1234}", new String[] {"httpDate: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: number"}}, - {"ns.foo#Structure4", "{\"httpDateTarget\": 1234}", new String[] {"httpDateTarget: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: number"}}, + {"ns.foo#Structure4", "{\"httpDate\": 1234}", new String[] {"httpDate: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: number"}}, + {"ns.foo#Structure4", "{\"httpDateTarget\": 1234}", new String[] {"httpDateTarget: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: number"}}, // timestamp member with no format. {"ns.foo#TimestampListNoFormatTrait", "[123]", null}, diff --git a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-header-tchar-validator.errors b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-header-tchar-validator.errors index f1242ede63f..b0650ee97ae 100644 --- a/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-header-tchar-validator.errors +++ b/smithy-model/src/test/resources/software/amazon/smithy/model/errorfiles/validators/http-header-tchar-validator.errors @@ -1 +1 @@ -[DANGER] ns.foo#SayHelloInput$myHeader: `Not valid!` is not a valid HTTP header field name according to section 3.2 of RFC 7230 | HttpHeaderTrait +[DANGER] ns.foo#SayHelloInput$myHeader: `Not valid!` is not a valid HTTP header field name according to section 5.6.2 of RFC 9110 | HttpHeaderTrait diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/MediaType.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/MediaType.java index 96492e0250a..66ff1679452 100644 --- a/smithy-utils/src/main/java/software/amazon/smithy/utils/MediaType.java +++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/MediaType.java @@ -26,7 +26,7 @@ /** * Implements a simple media type parser based on the Content-Type grammar defined in - * RFC 7231. + * RFC 9110. * *

The type, subtype, and parameter names are all canonicalized to * lowercase strings. @@ -154,7 +154,7 @@ public int hashCode() { } private static final class Parser extends SimpleParser { - // See https://tools.ietf.org/html/rfc7230#section-3.2.6 + // See https://tools.ietf.org/html/rfc9110#section-5.6.2 // token = 1*tchar // tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" // / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" @@ -198,7 +198,7 @@ private static final class Parser extends SimpleParser { } private void parse() { - // From: https://tools.ietf.org/html/rfc7231#section-3.1.1.1 + // From: https://tools.ietf.org/html/rfc9110#section-8.3.1 // The type, subtype, and parameter name tokens are case-insensitive. // media-type = type "/" subtype *( OWS ";" OWS parameter ) // type = token. @@ -240,7 +240,7 @@ private String parseToken() { return sliceFrom(start); } - // See https://tools.ietf.org/html/rfc7230#section-3.2.6 + // See https://tools.ietf.org/html/rfc9110#section-5.6.4 // quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE // qdtext = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text // obs-text = %x80-FF