Skip to content

Commit 8f2bb44

Browse files
committed
Appendix D
1 parent 9a6fa8e commit 8f2bb44

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

versions/3.0.4.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4217,24 +4217,24 @@ This will expand to the result:
42174217

42184218
## Appendix D: Serializing Headers and Cookies
42194219

4220-
RFC6570's percent-encoding behavior is not always appropriate for `in: "header"` and `in: "cookie"` parameters.
4220+
[RFC6570](https://www.rfc-editor.org/rfc/rfc6570)'s percent-encoding behavior is not always appropriate for `in: "header"` and `in: "cookie"` parameters.
42214221
In many cases, it is more appropriate to use `content` with a media type such as `text/plain` and require the application to assemble the correct string.
42224222

4223-
For both cookies ([RFC6265](https://www.rfc-editor.org/rfc/rfc6265)) and HTTP headers using the structured fields ([RFC8941](https://www.rfc-editor.org/rfc/rfc8941)) syntax, non-ASCII content is handled using base64 encoding (`format: "byte"`).
4224-
Note that the standard base64 encoding alphabet includes non-URL-safe characters that are percent-encoded by RFC6570 expansion; serializing values through both encodings is NOT RECOMMENDED.
4223+
For both [RFC6265](https://www.rfc-editor.org/rfc/rfc6265) cookies and HTTP headers using the [RFC8941](https://www.rfc-editor.org/rfc/rfc8941) structured fields syntax, non-ASCII content is handled using base64 encoding (`format: "byte"`).
4224+
Note that the standard base64-encoding alphabet includes non-URL-safe characters that are percent-encoded by RFC6570 expansion; serializing values through both encodings is NOT RECOMMENDED.
42254225

42264226
Most HTTP headers predate the structured field syntax, and a comprehensive assessment of their syntax and encoding rules is well beyond the scope of this specification.
4227-
While [RFC8187](https://www.rfc-editor.org/rfc/rfc8187) recommends percent-encoding HTTP field (header or trailer) parameters, these parameters appear after a `;` character.
4227+
While [RFC8187](https://www.rfc-editor.org/rfc/rfc8187) recommends percent-encoding HTTP (header or trailer) field parameters, these parameters appear after a `;` character.
42284228
With `style: "simple"`, that delimiter would itself be percent-encoded, violating the general HTTP field syntax.
42294229

42304230
Using `style: "form"` with `in: "cookie"` is ambiguous for a single value, and incorrect for multiple values.
42314231
This is true whether the multiple values are the result of using `explode: true` or not.
42324232

4233-
This style is specified to be equivalent to RFC6570 form expansion which includes the `?` character (see Appendix C for more details), which is not part of the cookie syntax.
4233+
This style is specified to be equivalent to RFC6570 form expansion which includes the `?` character (see [Appendix C](#appendix-c-using-rfc6570-implementations) for more details), which is not part of the cookie syntax.
42344234
However, examples of this style in past versions of this specification have not included the `?` prefix, suggesting that the comparison is not exact.
42354235
Because implementations that rely on an RFC6570 implementation and those that perform custom serialization based on the style example will produce different results, it is implementation-defined as to which of the two results is correct.
42364236

4237-
For multiple values, `style: form` is always incorrect as name=value pairs in cookies are delimited by `;` (a semicolon followed by a space character) rather than `&`.
4237+
For multiple values, `style: "form"` is always incorrect as name=value pairs in cookies are delimited by `;` (a semicolon followed by a space character) rather than `&`.
42384238

42394239
## Appendix E: Percent-Encoding and Form Media Types
42404240

0 commit comments

Comments
 (0)