I'm using web.py and Vue.js, when it gives a response header the bug occurs. I found that was because of in the header, Content-Length field was provided in number not string. I have to look up for the standard, and the standard didn't specify the Content-Length field has to be a string.
I tried my compiled Vue page with default python http.server, it works fine.
To be honest, I'm pretty new to python web dev, I'm not sure if this is a bug or it's a mistake made by myself. Here's the log:
127.0.0.1:49575 - - [06/May/2018 20:56:23] "HTTP/1.1 GET /" - 200 OK
-------------------[('Connection', 'close'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', 469)]
TypeError('WSGI response header value 469 is not of type str.',)
-------------------[('Connection', 'close'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', 469)]
-------------------[('Connection', 'close'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', 469)]
TypeError('WSGI response header value 469 is not of type str.',)
-------------------[('Connection', 'close'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', 469)]
TypeError('WSGI response header value 469 is not of type str.',)
Traceback (most recent call last):
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 1193, in communicate
req.respond()
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 997, in respond
self.server.gateway(self).respond()
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 140, in respond
for chunk in filter(None, response):
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 234, in __iter__
self.start_response(self.status, self.headers)
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 287, in xstart_response
out = start_response(status, response_headers, *args)
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 176, in start_response
'WSGI response header value %r is not of type str.' % v)
TypeError: WSGI response header value 469 is not of type str.
Traceback (most recent call last):
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 1193, in communicate
req.respond()
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 997, in respond
self.server.gateway(self).respond()
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 140, in respond
for chunk in filter(None, response):
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 234, in __iter__
self.start_response(self.status, self.headers)
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 287, in xstart_response
out = start_response(status, response_headers, *args)
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 176, in start_response
'WSGI response header value %r is not of type str.' % v)
TypeError: WSGI response header value 469 is not of type str.
TypeError('WSGI response header value 469 is not of type str.',)
Traceback (most recent call last):
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 1193, in communicate
req.respond()
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 997, in respond
self.server.gateway(self).respond()
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 140, in respond
for chunk in filter(None, response):
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 234, in __iter__
self.start_response(self.status, self.headers)
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 287, in xstart_response
out = start_response(status, response_headers, *args)
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 176, in start_response
'WSGI response header value %r is not of type str.' % v)
TypeError: WSGI response header value 469 is not of type str.
Traceback (most recent call last):
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 1193, in communicate
req.respond()
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 997, in respond
self.server.gateway(self).respond()
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 140, in respond
for chunk in filter(None, response):
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 234, in __iter__
self.start_response(self.status, self.headers)
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 287, in xstart_response
out = start_response(status, response_headers, *args)
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 176, in start_response
'WSGI response header value %r is not of type str.' % v)
TypeError: WSGI response header value 469 is not of type str.
-------------------[('Connection', 'close'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', 469)]
TypeError('WSGI response header value 469 is not of type str.',)
Traceback (most recent call last):
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 1193, in communicate
req.respond()
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 997, in respond
self.server.gateway(self).respond()
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 140, in respond
for chunk in filter(None, response):
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 234, in __iter__
self.start_response(self.status, self.headers)
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 287, in xstart_response
out = start_response(status, response_headers, *args)
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 176, in start_response
'WSGI response header value %r is not of type str.' % v)
TypeError: WSGI response header value 469 is not of type str.
-------------------[('Connection', 'close'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', 469)]
TypeError('WSGI response header value 469 is not of type str.',)
Traceback (most recent call last):
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 1193, in communicate
req.respond()
File "D:\Env\Python\lib\site-packages\cheroot\server.py", line 997, in respond
self.server.gateway(self).respond()
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 140, in respond
for chunk in filter(None, response):
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 234, in __iter__
self.start_response(self.status, self.headers)
File "D:\Env\Python\lib\site-packages\web\httpserver.py", line 287, in xstart_response
out = start_response(status, response_headers, *args)
File "D:\Env\Python\lib\site-packages\cheroot\wsgi.py", line 176, in start_response
'WSGI response header value %r is not of type str.' % v)
TypeError: WSGI response header value 469 is not of type str.
Lines starting with "-----------" are my debug output.
As I posted above.
Details