Backed out changeset 07b44dd04f0d (bug 1397646) for causing XHR related mochitest failures.

This commit is contained in:
Iulian Moraru
2023-08-01 01:56:42 +03:00
parent 7beb3fc5e7
commit 1e4a9bd3bd
3 changed files with 61 additions and 8 deletions

View File

@@ -2159,14 +2159,7 @@ HttpBaseChannel::GetResponseStatus(uint32_t* aValue) {
NS_IMETHODIMP
HttpBaseChannel::GetResponseStatusText(nsACString& aValue) {
if (!mResponseHead) return NS_ERROR_NOT_AVAILABLE;
nsAutoCString version;
// https://fetch.spec.whatwg.org :
// Responses over an HTTP/2 connection will always have the empty byte
// sequence as status message as HTTP/2 does not support them.
if (NS_WARN_IF(NS_FAILED(GetProtocolVersion(version))) ||
!version.EqualsLiteral("h2")) {
mResponseHead->StatusText(aValue);
}
mResponseHead->StatusText(aValue);
return NS_OK;
}