Cancelling a request in onBeforeRedirect doesn't actually do anything

Bug #1415662 reported by Chris Coulson on 2015-01-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Chris Coulson

Bug Description

I'm looking at bug 1399195 - the onBeforeRedirect test cancels the request in one case, but then never verifies that the request is actually cancelled. Having tried it, it turns out that this just doesn't work at all.

The issue is that the callback hangs off NetworkDelegate::OnBeforeRedirect(), which is called from net::URLRequest::Redirect(). If the application wants to prevent the redirect, Oxide calls net::URLRequet::Cancel(), but it's too late to do this and as soon as we return from NetworkDelegate::OnBeforeRedirect, Chromium restarts the request with the new URL.

To do this, we need to implement a ResourceThrottle, and call in to the application on ResourceThrottle::WillRedirectRequest. This is called much earlier than the NetworkDelegate callback, and gives us an opportunity to actually cancel the request properly.

Changed in oxide:
importance: Undecided → Medium
status: New → Triaged
milestone: none → branch-1.6
assignee: nobody → Chris Coulson (chrisccoulson)
status: Triaged → In Progress
description: updated
Changed in oxide:
milestone: branch-1.6 → branch-1.7
Changed in oxide:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers