Skip to content

Commit

Permalink
Backed out changeset a86a27857ef6 (bug 1453318) for causing multiple …
Browse files Browse the repository at this point in the history
…wpt failures. CLOSED TREE
  • Loading branch information
Iulian Moraru committed Aug 7, 2023
1 parent 1a15b46 commit 15248c3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
1 change: 0 additions & 1 deletion dom/base/domerr.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions netwerk/protocol/http/nsHttpResponseHead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions testing/web-platform/meta/xhr/headers-normalize-response.htm.ini
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions xpcom/base/ErrorList.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,6 @@ def SUCCESS(code):
# 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.
Expand Down

0 comments on commit 15248c3

Please sign in to comment.