Ticket #3679 defect closed fixed
new HTTP auth code throws away 1st segment of path
| Reported by: | philmayers | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | web | Keywords: | web, http, auth |
| Cc: | Branch: | branches/httpauth-wrapper-child-3679 | |
| Author: | exarkun | Launchpad Bug: |
Description
The code here:
http://twistedmatrix.com/trac/browser/trunk/twisted/web/_auth/wrapper.py#L98
...seems to have a bug. Specifically the getChildWithDefault does nothing with "path" so the 1st segment of the URL under the HTTPAuthSessionWrapper is throw away. I think this line:
http://twistedmatrix.com/trac/browser/trunk/twisted/web/_auth/wrapper.py#L121
...should read:
d = util.DeferredResource(self._login(credentials)) d.addCallback(lambda res: res.getChildWithDefault(path)) return d
...the symptoms of this bug are that with this:
class root(resource.Resource):
# render code
class child(resource.Resource):
# render code
root.putChild('foo', child())
...if I hit http://thesite/foo I just get another copy of the root page, but if I hit http://thesite/anyrandomstring/foo I get a copy of the child resource.
