mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1170937 - Set the URL on the Response object created from a fetch() properly if the underlying channel gets redirected; r=baku
This commit is contained in:
parent
9c8c24b5db
commit
7b565bd4da
@ -548,14 +548,16 @@ FetchDriver::ContinueHttpFetchAfterNetworkFetch()
|
||||
}
|
||||
|
||||
already_AddRefed<InternalResponse>
|
||||
FetchDriver::BeginAndGetFilteredResponse(InternalResponse* aResponse)
|
||||
FetchDriver::BeginAndGetFilteredResponse(InternalResponse* aResponse, nsIURI* aFinalURI)
|
||||
{
|
||||
MOZ_ASSERT(aResponse);
|
||||
if (!aResponse->FinalURL()) {
|
||||
nsAutoCString reqURL;
|
||||
nsAutoCString reqURL;
|
||||
if (aFinalURI) {
|
||||
aFinalURI->GetSpec(reqURL);
|
||||
} else {
|
||||
mRequest->GetURL(reqURL);
|
||||
aResponse->SetUrl(reqURL);
|
||||
}
|
||||
aResponse->SetUrl(reqURL);
|
||||
|
||||
// FIXME(nsm): Handle mixed content check, step 7 of fetch.
|
||||
|
||||
@ -584,7 +586,7 @@ FetchDriver::BeginAndGetFilteredResponse(InternalResponse* aResponse)
|
||||
void
|
||||
FetchDriver::BeginResponse(InternalResponse* aResponse)
|
||||
{
|
||||
nsRefPtr<InternalResponse> r = BeginAndGetFilteredResponse(aResponse);
|
||||
nsRefPtr<InternalResponse> r = BeginAndGetFilteredResponse(aResponse, nullptr);
|
||||
// Release the ref.
|
||||
}
|
||||
|
||||
@ -716,9 +718,17 @@ FetchDriver::OnStartRequest(nsIRequest* aRequest,
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
|
||||
response->InitChannelInfo(channel);
|
||||
|
||||
nsCOMPtr<nsIURI> channelURI;
|
||||
rv = channel->GetURI(getter_AddRefs(channelURI));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
FailWithNetworkError();
|
||||
// Cancel request.
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Resolves fetch() promise which may trigger code running in a worker. Make
|
||||
// sure the Response is fully initialized before calling this.
|
||||
mResponse = BeginAndGetFilteredResponse(response);
|
||||
mResponse = BeginAndGetFilteredResponse(response, channelURI);
|
||||
|
||||
nsCOMPtr<nsIEventTarget> sts = do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
|
@ -88,8 +88,9 @@ private:
|
||||
nsresult HttpFetch(bool aCORSFlag = false, bool aCORSPreflightFlag = false, bool aAuthenticationFlag = false);
|
||||
nsresult ContinueHttpFetchAfterNetworkFetch();
|
||||
// Returns the filtered response sent to the observer.
|
||||
// Callers who don't have access to a channel can pass null for aFinalURI.
|
||||
already_AddRefed<InternalResponse>
|
||||
BeginAndGetFilteredResponse(InternalResponse* aResponse);
|
||||
BeginAndGetFilteredResponse(InternalResponse* aResponse, nsIURI* aFinalURI);
|
||||
// Utility since not all cases need to do any post processing of the filtered
|
||||
// response.
|
||||
void BeginResponse(InternalResponse* aResponse);
|
||||
|
@ -27,12 +27,10 @@ skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
[test_fetch_basic_http.html]
|
||||
[test_fetch_basic_http_sw_reroute.html]
|
||||
skip-if = true # Bug 1170937, need fully support for redirects
|
||||
#skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
skip-if = e10s || buildapp == 'b2g' # Bug 1173163 for e10s, bug 1137683 for b2g
|
||||
[test_fetch_cors.html]
|
||||
[test_fetch_cors_sw_reroute.html]
|
||||
skip-if = true # Bug 1170937, need fully support for redirects
|
||||
#skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
skip-if = e10s || buildapp == 'b2g' # Bug 1173163 for e10s, bug 1137683 for b2g
|
||||
[test_formdataparsing.html]
|
||||
[test_formdataparsing_sw_reroute.html]
|
||||
skip-if = buildapp == 'b2g' # Bug 1137683
|
||||
|
Loading…
Reference in New Issue
Block a user