Django 1.6 と Python 3.4 でデモ プロキシ サーバーを作成しています。応答に次のヘッダーがある場合、エラーが発生します。
Transfer-Encoding=chunked
エラーは次のとおりです。
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
return self.application(environ, start_response)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 214, in __call__
start_response(force_str(status), response_headers)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 236, in start_response
assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed"
AssertionError: Hop-by-hop headers not allowed
この質問を見つけました: Django プロキシ ミドルウェアでホップバイホップ ヘッダーを許可しますが、Django 1.6 にはbasehttp._hop_headers
.
でサーバーを実行しますpython3.4 manage.py runserver
。
助けてください