Backed out changeset a86a27857ef6 (bug 1453318) for causing multiple wpt failures. CLOSED TREE

This commit is contained in:
Iulian Moraru 2023-08-07 06:42:15 +03:00
parent 1a15b46e51
commit 15248c3ea7
6 changed files with 17 additions and 18 deletions

View file

@ -126,7 +126,6 @@ DOM4_MSG_DEF(NotSupportedError, "The media resource indicated by the src attribu
DOM4_MSG_DEF(SyntaxError, "The URI is malformed.", NS_ERROR_DOM_MALFORMED_URI)
DOM4_MSG_DEF(SyntaxError, "Invalid header name.", NS_ERROR_DOM_INVALID_HEADER_NAME)
DOM4_MSG_DEF(SyntaxError, "Invalid header value.", NS_ERROR_DOM_INVALID_HEADER_VALUE)
/* XMLHttpRequest errors. */
DOM4_MSG_DEF(InvalidStateError, "XMLHttpRequest has an invalid context.", NS_ERROR_DOM_INVALID_STATE_XHR_HAS_INVALID_CONTEXT)

View file

@ -12642,12 +12642,6 @@
value: 5
mirror: always
# If true, requests will be canceled if any of the response headers values has a NUL character
- name: network.http.reject_NULs_in_response_header_values
type: RelaxedAtomicBool
value: true
mirror: always
# If true, remove the resumption token when 0RTT failed.
- name: network.http.remove_resumption_token_when_early_data_failed
type: RelaxedAtomicBool

View file

@ -7,7 +7,6 @@
// HttpLog.h should generally be included first
#include "HttpLog.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/Unused.h"
#include "nsHttpResponseHead.h"
#include "nsIHttpHeaderVisitor.h"
@ -595,14 +594,6 @@ nsresult nsHttpResponseHead::ParseHeaderLine_locked(
line, &hdr, &headerNameOriginal, &val))) {
return NS_OK;
}
// reject the header if there are 0x00 bytes in the value.
// (see https://github.com/httpwg/http-core/issues/215 for details).
if (StaticPrefs::network_http_reject_NULs_in_response_header_values() &&
val.FindChar('\0') >= 0) {
return NS_ERROR_DOM_INVALID_HEADER_VALUE;
}
nsresult rv;
if (originalFromNetHeaders) {
rv = mHeaders.SetHeaderFromNet(hdr, headerNameOriginal, val, true);

View file

@ -1,5 +1,11 @@
[resources-with-0x00-in-header.window.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Expect network error for image with 0x00 in a header]
expected: FAIL
[Expect network error for frame navigation to resource with 0x00 in a header]
expected: FAIL
[Expect network error for script with 0x00 in a header]
expected: FAIL

View file

@ -1,3 +1,14 @@
[headers-normalize-response.htm]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Header value: hello\\0world]
expected: FAIL
[Header value: \\0hello world]
expected: FAIL
[Header value: \\0]
expected: FAIL
[Header value: hello world\\0]
expected: FAIL

View file

@ -752,8 +752,6 @@ with modules["DOM"]:
# https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policies
errors["NS_ERROR_DOM_COOP_FAILED"] = FAILURE(1041)
errors["NS_ERROR_DOM_INVALID_HEADER_VALUE"] = FAILURE(1042)
# May be used to indicate when e.g. setting a property value didn't
# actually change the value, like for obj.foo = "bar"; obj.foo = "bar";
# the second assignment throws NS_SUCCESS_DOM_NO_OPERATION.