New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 644238 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 905971



Sign in to add a comment

2 calls to a 302-redirecting script are shown in network panel, if the target is NOT within the same origin

Reported by chaolbvb...@gmail.com, Sep 6 2016

Issue description

Chrome Version       : 52.0.2743.116 (Official Build) (64-bit)
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari: OK
    Firefox: OK
         IE: OK

What steps will reproduce the problem?
(1) do an ajax request to a script A.
(2) script A will redirect to another resource B with a 302 status code
(3a) resource B is within the same origin
(3b) resource B is NOT within the same origin   

What is the expected result?
in both cases 3a and 3b the redirecting script and the final resource and only those two should be visible in the network panel 

What happens instead?
if resource B in NOT within the same origin, two calls to the redirecting script are visible, with two different initiators, one being the script itself

Please provide any additional information below. Attach a screenshot if
possible.
Although two requests a shown in the network panel, luckily only one call to the script is performed. 
 
Screen Shot 2016-09-06 at 14.14.21.png
144 KB View Download
Labels: Needs-Feedback
Would you be able to supply the markup of the page that reproduces this?
Components: Blink>Network>XHR Blink>SecurityFeature
Not sure if this is a general CORS issue, or something XHR-specific.  A repro would be great, as it could also be expected behavior, given the Javascript.
You can find a repro here: http://chaolbvbiens.net/redirect.html

Screen Shot 2016-09-06 at 22.03.22.png
405 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Sep 14 2016

Labels: -Needs-Feedback Needs-Review
Owner: elawrence@chromium.org
Thank you for providing more feedback. Adding requester "elawrence@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: -Blink>SecurityFeature -Blink>Network>XHR Platform>DevTools>Network
Labels: -Needs-Review
Owner: ----
Status: Untriaged (was: Unconfirmed)
Confirmed in 55.0.2860.0

Network-level monitoring shows one request hits the network.

chrome://net-internals tracing shows only one request:

 URL_REQUEST http://chaolbvbiens.net/redirect.php?sameOrigin=false

Chrome Network panel shows two entries, including one spurious entry with a bogus initiator.

As such, I believe this is only a quirk of how the DevTools Network panel collects data, so changing Component accordingly.
spurious.png
22.1 KB View Download
Owner: allada@chromium.org
Status: Assigned (was: Untriaged)

Comment 7 by allada@chromium.org, Sep 15 2016

Cc: japhet@chromium.org
Labels: -Pri-3 Pri-1
Status: Started (was: Assigned)

Comment 8 by allada@chromium.org, Sep 27 2016

Cc: toyoshim@chromium.org
Status: Assigned (was: Started)
+toyoshim, we could use your input on this:

It appears that we are allowing both ResourceFetcher::willFollowRedirect and RawResource::willFollowRedirect to dispatch the same request.

Here's a simple stack trace of where the stacks diverge:

debug::StackTrace::StackTrace()
InspectorNetworkAgent::willSendRequestInternal()
InspectorNetworkAgent::willSendRequest()
InspectorInstrumentation::willSendRequest()
FrameFetchContext::dispatchWillSendRequest()
ResourceFetcher::willSendRequest()
ResourceFetcher::startLoad()
ResourceFetcher::requestResource()
RawResource::fetch()
DocumentThreadableLoader::loadRequest()
DocumentThreadableLoader::makeCrossOriginAccessRequest()
DocumentThreadableLoader::redirectReceived()
RawResource::willFollowRedirect()

ResourceLoader::willFollowRedirect()
WebURLLoaderImpl::Context::OnReceivedRedirect()
WebURLLoaderImpl::RequestPeerImpl::OnReceivedRedirect()
ResourceDispatcher::OnReceivedRedirect()

And:

debug::StackTrace::StackTrace()
InspectorNetworkAgent::willSendRequestInternal()
InspectorNetworkAgent::willSendRequest()
InspectorInstrumentation::willSendRequest()
FrameFetchContext::dispatchWillSendRequest()
ResourceFetcher::willSendRequest()
ResourceFetcher::willFollowRedirect()

ResourceLoader::willFollowRedirect()
WebURLLoaderImpl::Context::OnReceivedRedirect()
WebURLLoaderImpl::RequestPeerImpl::OnReceivedRedirect()
ResourceDispatcher::OnReceivedRedirect()


If you would like I could maybe explain it a bit better offline if you need more clarification.

Comment 9 by allada@chromium.org, Jul 24 2017

Issue 747065 has been merged into this issue.
 crbug.com/644238  has an easy repro case.
Owner: toyoshim@chromium.org
@toyoshim: over to you per allada's request, could you clarify?
Cc: allada@chromium.org
 Issue 607054  has been merged into this issue.
Labels: -Pri-1 Pri-2
I think this is a possible issue.
In the DocumentThreadableLoader, we create another resource load request on a cross-origin redirect because we need to modify HTTP request headers, but existing redirect interface does not allow it.

This problem should be solved once my out-of-blink CORS works are finished.
What is the status of this issue?
Blockedon: 905971
Labels: M-72
Status: Started (was: Assigned)
I confirmed that the issue was fixed if OOR-CORS is enabled.
Status: Fixed (was: Started)
Thanks!

Sign in to add a comment