【问题标题】:uwsgi breaks headersuwsgi 打破标题
【发布时间】: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 两次发送相同的标头,甚至更多次被破坏。

【问题讨论】:

标签: http-headers nginx python-3.x uwsgi


【解决方案1】:

uWSGI 和 nginx 哪个版本?在 0.9.8.x 和 1.0.x 中,我无法重现您的错误。

你可以通过 --http/--http-socket 来检查 uWSGI 发送的真正的头文件

【讨论】:

  • 那是 ubuntu 的 uwsgi-python3 的 bug。我刚刚下载了普通 uwsgi 的稳定版本,为 pyhton3 编译了它,现在一切正常。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-20
  • 2017-10-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多