[Twisted-web] Peculiarity with putChild() using the root of the webserver

Rich Brown richb.hanover at gmail.com
Wed Nov 14 22:05:27 EST 2012

I have been playing with Twisted 12.2.0, and encountered this minor

1) Files not at the root of the web server work as expected:

a) putChild("foo", File("some-directory")) works as expected - URL is

b) Navigating to the directory "bar" within "foo" gives a URL of
http://example.com/foo/bar/ as expected.

2) Files at the root of the web server wind up with an extra "/" in the URL:

a)  putChild("", File("some-directory")) yields a URL of
http://example.com//   <-- note double slash

b) navigating to the same directory "bar" gives: http://example.com//bar
<-- double-slash again...


I think it would make sense to special the case of the root directory and
not output a double "//" in the URL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20121114/a2ecd0ea/attachment.htm 

More information about the Twisted-web mailing list