parseRequestBody picked JSON, urlencoded or multipart with
contentType.includes() on the raw header. That is case-sensitive, so a
valid Application/JSON reached the handler as a string, and it
matches anywhere in the header, so a parameter could choose the
parser: text/plain; x=application/json was parsed as JSON.
The media type is now taken from the part before any ;, trimmed and
lowercased (RFC 9110 §8.3.1), and compared exactly. The boundary is
still read from the full header.
A type that merely contains one of the three no longer selects its
parser. application/json-patch+json used to be parsed as JSON and
now arrives as text, as other +json types always have. CHANGELOG
says so.
test/http.test.ts sends both cases from the issue, plus their
urlencoded equivalents, through the Node server.
parseRequestBody picked JSON, urlencoded or multipart with
contentType.includes() on the raw header. That is case-sensitive, so a
valid `Application/JSON` reached the handler as a string, and it
matches anywhere in the header, so a parameter could choose the
parser: `text/plain; x=application/json` was parsed as JSON.
The media type is now taken from the part before any `;`, trimmed and
lowercased (RFC 9110 §8.3.1), and compared exactly. The boundary is
still read from the full header.
A type that merely contains one of the three no longer selects its
parser. `application/json-patch+json` used to be parsed as JSON and
now arrives as text, as other `+json` types always have. CHANGELOG
says so.
test/http.test.ts sends both cases from the issue, plus their
urlencoded equivalents, through the Node server.
parseRequestBody picked JSON, urlencoded or multipart with
contentType.includes() on the raw header. That is case-sensitive, so a
valid `Application/JSON` reached the handler as a string, and it
matches anywhere in the header, so a parameter could choose the
parser: `text/plain; x=application/json` was parsed as JSON.
The media type is now taken from the part before any `;`, trimmed and
lowercased (RFC 9110 §8.3.1), and compared exactly. The boundary is
still read from the full header.
A type that merely contains one of the three no longer selects its
parser. `application/json-patch+json` used to be parsed as JSON and
now arrives as text, as other `+json` types always have. CHANGELOG
says so.
test/http.test.ts sends both cases from the issue, plus their
urlencoded equivalents, through the Node server.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Exact matching left `application/json-patch+json` arriving as text,
where the old substring check had parsed it, and still left the other
`+json` types (`application/problem+json`, `application/vnd.api+json`)
as text, as they always were. `+json` is the structured-syntax suffix
for JSON (RFC 6839), so any media type ending in it is parsed as JSON.
`application/jsonx` and parameters that only mention JSON still are not.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
parseRequestBody picked JSON, urlencoded or multipart with
contentType.includes() on the raw header. That is case-sensitive, so a
valid
Application/JSONreached the handler as a string, and itmatches anywhere in the header, so a parameter could choose the
parser:
text/plain; x=application/jsonwas parsed as JSON.The media type is now taken from the part before any
;, trimmed andlowercased (RFC 9110 §8.3.1), and compared exactly. The boundary is
still read from the full header.
A type that merely contains one of the three no longer selects its
parser.
application/json-patch+jsonused to be parsed as JSON andnow arrives as text, as other
+jsontypes always have. CHANGELOGsays so.
test/http.test.ts sends both cases from the issue, plus their
urlencoded equivalents, through the Node server.
aef9640b50to79925595b5