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

Issue 839155 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

didReceiveResponse delegate method is not called when client doesn't follow redirect

Project Member Reported by kapishnikov@chromium.org, May 2 2018

Issue description

According to https://developer.apple.com/documentation/foundation/nsurlsession?language=objc:
"If the response is an HTTP redirect response, the NSURLSession object calls the delegate’s URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler: method. That delegate method calls the provided completion handler with either the provided NSURLRequest object (to follow the redirect), a new NSURLRequest object (to redirect to a different URL), or nil (to treat the redirect’s response body as a valid response and return it as the result)."

That means that if the client calls completionHandler(nil), the redirect request is treated as valid response and the subsequent didReceiveResponse: & didReceiveData: methods should be called. These methods are not called in case of Cronet.

As a side note, this functionality is not supported on Android either. I.e., the client can only decide whether a redirect should be followed or not. The client cannot access the content of the body.
 
Cc: danyao@chromium.org
Components: -Internals>Network>Library Mobile>WebView>Glue
Owner: eugene...@chromium.org
Status: Assigned (was: Untriaged)
Cc: -danyao@chromium.org
Components: -Mobile>WebView>Glue Internals>Network
Owner: ----
Status: Untriaged (was: Assigned)
Seems like a Chronet bug
Components: -Internals>Network Internals>Network>Library

Comment 4 by pkl@chromium.org, May 7 2018

For kapishnikov@ to triage and assign.
Owner: kapishnikov@chromium.org
Status: Assigned (was: Untriaged)
Owner: ----
Status: Untriaged (was: Assigned)
Owner: mef@chromium.org
Status: Assigned (was: Untriaged)
mef: can you find an appropriate owner for this bug?  Thanks!
Owner: ----
Status: Available (was: Assigned)
Cc: rmahin...@uber.com
Labels: -Pri-3 M-71 Pri-2
Bumping up the priority as this issue may be blocking client deployment.
Underlying chromium //net stack doesn't provide response body for redirects.

We can modify the redirect response in HttpProtocolHandlerCore::OnReceivedRedirect() to explicitly set Content-Length to 0 to indicate that there is no response data available. 

This should prevent the client from waiting for response data.
Labels: -M-71
rmahindra@: Is this issue still important for you?

Sign in to add a comment