Hello,
I found what I think may be a bug in URLParser.py. When a request for a
directory is missing a trailing slash, a redirect is generated with the
trailing slash. The problem is that the query string is left out of the
redirect url and gets lost.
I noticed this problem when updating a webware site to webware 0.9
recently. Looking at the source code I found the problem.
From URLParser.py in class _FileParser in method parseIndex (line 493):
# If requestPath is empty, then we're missing the trailing slash:
if not requestPath:
raise HTTPMovedPermanently(
webkitLocation=trans.request().urlPath() + "/")
I modified the code snippet above to read as follows and it seems to work:
# If requestPath is empty, then we're missing the trailing slash:
if not requestPath:
qs = trans.request().queryString()
if qs:
qs = "?" + qs
raise HTTPMovedPermanently(
webkitLocation=trans.request().urlPath() + "/" + qs)
Am I on the right track here? Is this a bug or am I missing something?
Thanks for your attention,
- Sam
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss