【发布时间】:2012-01-11 04:23:58
【问题描述】:
我正在使用 Nginx + uwsgi + python3
通过 start_response 发送任何 header 都很好,但是当我想发送多个 header 时,它变得很疯狂。 例如,如果我写:
start_response('200 OK', [('Last-Modified', 'Wed, 11 Jan 2012 00:00:00 GMT'), ('Content-Type', 'text/html; charset=windows-1251')])
发送的标头是:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: nginx/1.0.11
Connection: close
Date: Wed, 11 Jan 2012 04:17:22 GMT
Content-Type: text/html; charset=windows-1251
Content-Type: text/html; charset=windows-12
uwsgi 两次发送相同的标头,甚至更多次被破坏。
【问题讨论】:
-
一个可能的原因是字符串python3保存在unicode中,但projects.unbit.it/uwsgi/wiki/RunOnPython3k表示处理它们没有问题
标签: http-headers nginx python-3.x uwsgi