Message20250
Logged In: YES
user_id=371366
I agree that it is a server error to put something that doesn't
meet the syntactic definition of a URI in the Location header
of a response. I don't see any harm in correcting obvious
errors, though, in the interest of usability.
As for your proposed fix, instead of just correcting spaces, I
would do
newurl = quote(newurl, safe="/:=&?#+!$,;'@()*[]")
quote() is a urllib function that does percent-encoding. It is
way out of date and does poorly with Unicode strings, but if
called with the above arguments, it should safely clean up
most mistakes. The set of additional "safe" characters I am
passing in is the complete set of "reserved" characters
according to the latest draft of RFC 2396bis; these are
characters that definitely do or might possibly have special
meaning in a URL and thus should not be percent-encoded
blindly.
I am currently working on a urllib.quote() replacement for
4Suite's Ft.Lib.Uri library, and will then see about getting the
improvements folded back into urllib. |
|
Date |
User |
Action |
Args |
2007-08-23 14:20:25 | admin | link | issue918368 messages |
2007-08-23 14:20:25 | admin | create | |
|