Skip to content

Commit

Permalink
Bug 1397646 - return empty statusText for HTTP2 fetches and XMLHttpRe…
Browse files Browse the repository at this point in the history
…quests; r=kershaw,necko-reviewers,sunil

Differential Revision: https://phabricator.services.mozilla.com/D184527
  • Loading branch information
wisniewskit committed Aug 7, 2023
1 parent 15248c3 commit ae64997
Show file tree
Hide file tree
Showing 11 changed files with 669 additions and 613 deletions.
5 changes: 5 additions & 0 deletions dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
#include "nsSize.h"
#include "nsThreadUtils.h"
#include "nsURIHashKey.h"
#include "nsURLHelper.h"
#include "nsVideoFrame.h"
#include "ReferrerInfo.h"
#include "TimeUnits.h"
Expand Down Expand Up @@ -1305,6 +1306,10 @@ HTMLMediaElement::MediaLoadListener::OnStartRequest(nsIRequest* aRequest) {
Unused << hc->GetResponseStatus(&responseStatus);
nsAutoCString statusText;
Unused << hc->GetResponseStatusText(statusText);
// we need status text for resist fingerprinting mode's message allowlist
if (statusText.IsEmpty()) {
net_GetDefaultStatusTextForCode(responseStatus, statusText);
}
element->NotifyLoadError(
nsPrintfCString("%u: %s", responseStatus, statusText.get()));

Expand Down
4 changes: 4 additions & 0 deletions dom/xhr/tests/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ support-files =
xhr_worker.js
xhr2_worker.js
xhrAbort_worker.js
test_XHR.js
test_worker_xhr_parameters.js
test_worker_xhr_system.js
worker_xhr_cors_redirect.js
Expand Down Expand Up @@ -114,6 +115,7 @@ skip-if =
[test_worker_xhrAbort.html]
skip-if = (os == "win") || (os == "mac")
[test_XHR.html]
skip-if = http2
[test_xhr_abort_after_load.html]
[test_XHR_anon.html]
skip-if =
Expand All @@ -124,6 +126,8 @@ skip-if =
skip-if =
http3
http2
[test_XHR_http2.html]
skip-if = !http2
[test_XHR_onuploadprogress.html]
[test_xhr_overridemimetype_throws_on_invalid_state.html]
[test_XHR_parameters.html]
Expand Down
Loading

0 comments on commit ae64997

Please sign in to comment.