Skip to content

Commit

Permalink
Replace RFC 7231 with RFC 9110
Browse files Browse the repository at this point in the history
RFC 7231 was obsoleted by RFC 9110 in 2022. This updates references
to the old RFC to the equivalent sections in the new one. Note that
the actual content of the referenced sections are semantically
unchanged.
  • Loading branch information
JordonPhillips committed May 23, 2024
1 parent 3575395 commit 39006f9
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/source-1.0/spec/core/http-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,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
Expand Down
2 changes: 1 addition & 1 deletion docs/source-1.0/spec/core/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
Expand Down
2 changes: 1 addition & 1 deletion docs/source-1.0/spec/core/protocol-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/behavior-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/http-bindings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,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::
Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/protocol-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/service-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ public static Collection<Object[]> 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},
Expand All @@ -267,8 +267,8 @@ public static Collection<Object[]> 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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/**
* Implements a simple media type parser based on the Content-Type grammar defined in
* <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1">RFC 7231</a>.
* <a href="https://tools.ietf.org/html/rfc9110#section-8.3">RFC 9110</a>.
*
* <p>The type, subtype, and parameter names are all canonicalized to
* lowercase strings.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 39006f9

Please sign in to comment.