[Web-SIG] WSGI for Python 3
And Clover
and-py at doxdesk.com
Fri Jul 16 11:33:21 CEST 2010
On 07/14/2010 06:43 AM, Ian Bicking wrote:
> There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO,
> and HTTP_COOKIE.
(And of those, PATH_INFO is the only one that really matters, in that
no-one really uses non-ASCII script filenames, and non-ASCII characters
in Cookie/Set-Cookie are still handled so differently/brokenly across
browsers that you can't rely on them at all.)
> * I (re)propose we eliminate SCRIPT_NAME and PATH_INFO and replace them
> exclusively with encoded versions
For compatibility with existing apps, how about keeping the existing
SCRIPT_NAME and PATH_INFO as-is (with all their problems), and
specifying that the new 'raw' versions (whatever they are called) are
added only if they really are raw, not reconstructed.
Then existing scripts that don't care about non-ASCII and slashes can
carry on as before, and for apps that do care about them, they'll be
able to be *sure* the input is correct. Or they can fall back to
PATH_INFO when not present, and avoid producing these kind of URLs in
response.
(Or an app might have enough special knowledge to try other fallback
mechanisms when the raw versions are unavailable, such as REQUEST_URI or
Windows ctypes envvar hacking. But if the server/gateway has good raw
paths it shouldn't bother use these.)
--
And Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/
More information about the Web-SIG
mailing list