diff --git a/dom/base/nsXMLHttpRequest.cpp b/dom/base/nsXMLHttpRequest.cpp index dbc93d0334..4d2f892b0c 100644 --- a/dom/base/nsXMLHttpRequest.cpp +++ b/dom/base/nsXMLHttpRequest.cpp @@ -1653,15 +1653,11 @@ nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url, method = inMethod; // other methods are not normalized } - // sync request is not allowed using withCredential or responseType + // sync request is not allowed to use responseType or timeout // in window context if (!async && HasOrHasHadOwner() && - (mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS || - mTimeoutMilliseconds || + (mTimeoutMilliseconds || mResponseType != XML_HTTP_RESPONSE_TYPE_DEFAULT)) { - if (mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS) { - LogMessage("WithCredentialsSyncXHRWarning", GetOwner()); - } if (mTimeoutMilliseconds) { LogMessage("TimeoutSyncXHRWarning", GetOwner()); } @@ -3426,14 +3422,6 @@ nsXMLHttpRequest::SetWithCredentials(bool aWithCredentials, ErrorResult& aRv) return; } - // sync request is not allowed setting withCredentials in window context - if (HasOrHasHadOwner() && - !(mState & (XML_HTTP_REQUEST_UNSENT | XML_HTTP_REQUEST_ASYNC))) { - LogMessage("WithCredentialsSyncXHRWarning", GetOwner()); - aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR); - return; - } - if (aWithCredentials) { mState |= XML_HTTP_REQUEST_AC_WITH_CREDENTIALS; } else { diff --git a/dom/base/test/test_xhr_withCredentials.html b/dom/base/test/test_xhr_withCredentials.html index e863c6af36..71d7dcccf1 100644 --- a/dom/base/test/test_xhr_withCredentials.html +++ b/dom/base/test/test_xhr_withCredentials.html @@ -18,15 +18,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=814050