Merge lp:~leonardr/lazr.restful/invalid-uri into lp:lazr.restful
Proposed by
Leonard Richardson
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | 148 |
Merged at revision: | 148 |
Proposed branch: | lp:~leonardr/lazr.restful/invalid-uri |
Merge into: | lp:lazr.restful |
Diff against target: |
66 lines (+26/-4) 3 files modified
src/lazr/restful/example/base/tests/redirect.txt (+8/-0) src/lazr/restful/example/base/traversal.py (+5/-0) src/lazr/restful/publisher.py (+13/-4) |
To merge this branch: | bzr merge lp:~leonardr/lazr.restful/invalid-uri |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+36759@code.launchpad.net |
Description of the change
This branch fixes bug 535078.
Let's say you access a web service page by making an Ajax call with your web browser. Let's say the underlying application redirects you to some other page. And let's say the Location header contains invalid characters like {} or [].
Without this branch, lazr.restful will try to parse the URL in that location header using lazr.uri, and lazr.uri will choke on the invalid characters. But it's really none of lazr.restful's business whether the Location header contains invalid characters. This branch changes lazr.restful to use urllib to parse the Location header instead of the more picky lazr.uri library.
To post a comment you must log in.
In most cases, a browser that follows the Location header will get a 404 error or some other error, because invalid characters in URLs usually mean something's wrong. But, again, it's not lazr.restful's job to raise an exception at this point. With this branch, the error is more likely to be comprehensible to the client.