Author grahamd
Recipients aclover, animus, claudep, docs@python, grahamd, martin.panter, pje
Date 2016-04-21.05:16:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1461215769.25.0.114013932381.issue16679@psf.upfronthosting.co.za>
In-reply-to
Content
What I get in Apache for:

http://127.0.0.1:8000/a=тест

in Safari browser is:

'REQUEST_URI': '/a=%D1%82%D0%B5%D1%81%D1%82',
'PATH_INFO': '/a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',

Where as for curl see:

'REQUEST_URI': '/a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',
'PATH_INFO': '/a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',

For:

http://127.0.0.1:8000/?a=тест

in Safari get:

'REQUEST_URI': '/?a=%D1%82%D0%B5%D1%81%D1%82',
'PATH_INFO': '/'
'QUERY_STRING': 'a=%D1%82%D0%B5%D1%81%D1%82',

and curl:

'REQUEST_URI': '/?a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',
'PATH_INFO': '/',
'QUERY_STRING': 'a=\xc3\x91\\x82\xc3\x90\xc2\xb5\xc3\x91\\x81\xc3\x91\\x82',

So yes curl sends as bytes rather than encoded, expected that.

Gunicorn on:

http://127.0.0.1:8000/a=тест

sees for Safari:

 'PATH_INFO': '/a=Ñ\x82еÑ\x81Ñ\x82',
 'QUERY_STRING': '',
 'RAW_URI': '/a=%D1%82%D0%B5%D1%81%D1%82',

and curl:

 'PATH_INFO': '/a=Ã\x91Â\x82Ã\x90µÃ\x91Â\x81Ã\x91Â\x82',
 'QUERY_STRING': '',
 'RAW_URI': '/a=Ñ\x82еÑ\x81Ñ\x82',

Gunicorn on:

http://127.0.0.1:8000/?a=тест

sees for Safari:

 'PATH_INFO': '/',
 'QUERY_STRING': 'a=%D1%82%D0%B5%D1%81%D1%82',
 'RAW_URI': '/?a=%D1%82%D0%B5%D1%81%D1%82',

and curl:

 'PATH_INFO': '/',
 'QUERY_STRING': 'a=Ñ\x82еÑ\x81Ñ\x82',
 'RAW_URI': '/?a=Ñ\x82еÑ\x81Ñ\x82',

So in Apache I get through UTF-8 byte string as Latin-1. So can see multi byte characters. Gunicorn is doing something different when gets raw bytes from curl. As does wsgiref. Showed Gunicorn as it has RAW_URI which is supposed to be the same as REQUEST_URI in Apache, but actually isn't showing the same there either.

Whatever is happening, mod_wsgi still gives a good outcome.
History
Date User Action Args
2016-04-21 05:16:09grahamdsetrecipients: + grahamd, pje, aclover, docs@python, martin.panter, animus, claudep
2016-04-21 05:16:09grahamdsetmessageid: <1461215769.25.0.114013932381.issue16679@psf.upfronthosting.co.za>
2016-04-21 05:16:09grahamdlinkissue16679 messages
2016-04-21 05:16:08grahamdcreate