[Webkit-unassigned] [Bug 12106] New: Changed URL from WebResourceLoadDelegate's webView:resource:willSendRequest:... is ignored

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 3 15:41:30 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=12106

           Summary: Changed URL from WebResourceLoadDelegate's
                    webView:resource:willSendRequest:... is ignored
           Product: WebKit
           Version: 420+ (nightly)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Keywords: Regression
          Severity: Major
          Priority: P2
         Component: Page Loading
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dwood at karelia.com


If you have a WebResourceLoadDelegate that defines
webView:resource:willSendRequest:redirectResponse:fromDataSource: to return a
new NSURLRequest, that new URL request is ignored, and the original URL is
used.

I believe that I have traced this to this method.

When this is called, newRequest is <NSMutableURLRequest
applewebdata://85A64C16-16E4-4262-909B-109A07DB268C/_Media/placeholder_large.jpeg>

My delegate code, called downstream from ResourceLoader::willSendRequest, sets
clientRequest to <NSURLRequest
media:/11D16F2645B64AB190E6/placeholder_large.jpeg>

It's not clear to me whether the "if" branch should be taken and there is a bug
there, or if there is a bug in the test logic, or if there is a bug in that
oldURL is set to nil, messing up the test.

NSURLRequest *SubresourceLoader::willSendRequest(NSURLRequest *newRequest,
NSURLResponse *redirectResponse)
{
    NSURL *oldURL = [request() URL];   // NOTE: THIS RETURNS NIL -- I DON'T
KNOW WHY
    NSURLRequest *clientRequest = ResourceLoader::willSendRequest(newRequest,
redirectResponse);
    if (clientRequest && oldURL != [clientRequest URL] && ![oldURL
isEqual:[clientRequest URL]]) {
        ResourceRequest request = newRequest;
        if (m_client)
            m_client->willSendRequest(this, request, redirectResponse);

        return request.nsURLRequest();
    }

    return clientRequest;
}


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list