Skip to content

Commit 7833bfe

Browse files
describe behaviour when deserializing a multipart with a Content-Type header
1 parent 75d0fae commit 7833bfe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/oas.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,8 @@ This table is based on the value to which the Encoding Object is being applied a
17291729
Note that in the case of [Encoding By Name](#encoding-by-name), this value is the array item for properties of type `"array"`, and the entire value for all other types.
17301730
Therefore the `array` row in this table applies only to array values inside of a top-level array when encoding by name.
17311731

1732+
When deserializing a multipart message, if a `Content-Type` header is present in the specific part, its value shall be used instead of these values. Behavior is undefined when both this header and `contentType` are defined but with different values.
1733+
17321734
| `type` | `contentEncoding` | Default `contentType` |
17331735
| ---- | ---- | ---- |
17341736
| [_absent_](#working-with-binary-data) | _n/a_ | `application/octet-stream` |
@@ -1864,7 +1866,7 @@ Note that there are significant restrictions on what headers can be used with `m
18641866

18651867
##### Handling Multiple `contentType` Values
18661868

1867-
When multiple values are provided for `contentType`, parsing remains straightforward as the part's actual `Content-Type` is included in the document.
1869+
When multiple values are provided for `contentType`, parsing remains straightforward as the part's actual `Content-Type` is included in the document; it SHOULD match one of the media types in `contentType`, if it is present.
18681870

18691871
For encoding and serialization, implementations MUST provide a mechanism for applications to indicate which media type is intended.
18701872
Implementations MAY choose to offer media type sniffing ([[SNIFF]]) as an alternative, but this MUST NOT be the default behavior due to the security risks inherent in the process.

0 commit comments

Comments
 (0)