Skip to content

wxpython-response.py example: final url is wrong when doing redirects #173

@GoogleCodeExporter

Description

@GoogleCodeExporter
Hello,

I need to get the status code of the initial url loaded in the browser, and 
also the final url the initial one might have redirected to. So for instance if 
I load http://httpbin.org/redirect-to?url=/status/418 I expect to get status 
code = 302 and final url = http://httpbin.org/status/418. 

This doesn't work on the wxpython-response example though. Only one 
ResouceHandler is created (and all other objects in the chain) and the status 
code associated with its response is 418. Also if at any point after OnLoadEnd 
I do browser.GetUrl() or even run javascript to get window.location.href, I get 
the initial url. I thought it had something to do with the unused 
redirectUrlOut parameter to ResourceHandler.GetResponseHeaders but the only 
time this method is called the headers I get are those of the final url, never 
the initial ones which contain the Location key.

To reproduce, simply change the navigateUrl parameter in line 362 of 
wxpython-response.py to "http://httpbin.org/redirect-to?url=/status/418". 
Opening the initial url on a regular chrome browser yields the expected 
behavior.

Original issue reported on code.google.com by luiz.ge...@sieve.com.br on 16 Feb 2015 at 2:13

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions