Ticket #818 (defect)
Opened 3 months ago
Last modified 3 months ago
No content type being sent to cherry py on refresh
Status: closed (fixed)
| Reported by: | voodoonofx@gmail.com | Assigned to: | fumanchu |
|---|---|---|---|
| Priority: | high | Milestone: | 2.3 |
| Component: | CherryPy code | Keywords: | |
| Cc: |
When hosting CherryPy on my Windows Vista Ultimate machine with: CherryPy 2.3.0, Python 2.5.2, Turbogears 1.0.4.4 and Internet Explorer 7.0 or Firefox 2.0.0.1.4
I get the following error after a user has visited a page, and refreshs the page:
- - "GET /static/images/cars/micro/Mseries.jpg HTTP/1.1" 500 1363 "http://localhost:8080/car/search/3" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC 1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2; .NET CLR 1.1.4322)"
2008-05-22 09:04:59,342 cherrypy.msg INFO HTTP: Traceback (most recent call last):
File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\_cphttptools.py", line 135, in _run
applyFilters('before_finalize')
File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\filters\__init__.py", line 151, in applyFilters
method()
File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\filters\logdebuginfofilter.py", line 23, in before_finalize
ct = cherrypy.response.headers.get('Content-Type').split(';')[0]AttributeError: 'NoneType' object has no attribute 'split'
Request Headers:
REFERER: http://localhost:8080/car/search/3
IF-MODIFIED-SINCE: Thu, 15 May 2008 21:33:34 GMT
Content-Length:
USER-AGENT: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR
2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2; .NET CLR 1.1.43
22)
CONNECTION: Keep-Alive
COOKIE: visit=1f3b296067a2b6730b5b0f10b002372e3fd8bca8
HOST: localhost:8080
UA-CPU: x86
ACCEPT: */*
Remote-Addr: ::1
ACCEPT-LANGUAGE: en-us
Content-Type:
ACCEPT-ENCODING: gzip, deflate
- - "GET /static/images/cars/micro/Xseries.jpg HTTP/1.1" 500 1363 "http://local
host:8080/car/search/3" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC
1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2; .NET
CLR 1.1.4322)"
2008-05-22 09:04:59,448 cherrypy.msg INFO HTTP: Traceback (most recent call last
):
File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\_cphttpt
ools.py", line 135, in _run
applyFilters('before_finalize')
File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\filters\
__init__.py", line 151, in applyFilters
method()
File "c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\filters\
logdebuginfofilter.py", line 23, in before_finalize
ct = cherrypy.response.headers.get('Content-Type').split(';')[0]
AttributeError: 'NoneType' object has no attribute 'split'
Request Headers:
REFERER: http://localhost:8080/car/search/3
IF-MODIFIED-SINCE: Thu, 15 May 2008 21:39:38 GMT
Content-Length:
USER-AGENT: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR
2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2; .NET CLR 1.1.43
22)
CONNECTION: Keep-Alive
COOKIE: visit=1f3b296067a2b6730b5b0f10b002372e3fd8bca8
HOST: localhost:8080
UA-CPU: x86
ACCEPT: */*
Remote-Addr: ::1
ACCEPT-LANGUAGE: en-us
Content-Type:
ACCEPT-ENCODING: gzip, deflate
- - "GET /static/images/cars/micro/Zseries.jpg HTTP/1.1" 500 1363 "http://local
host:8080/car/search/3" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC
1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2; .NET
CLR 1.1.4322)"
Content-Type is being sent back as NoneType?, causing CP to return a 500 error on most static content such as images, css, and js files.
I don't remember this happening when I hosted CP on my CentOS 5.1 box, but maybe it was happening there too.
IRC Log:
<VooDooNOFX> I've got turbogears running on a windows vista box, and whenever I refresh a page, IE seems to not send the content-type to cherrypy, which causes the error above <@fumanchu> that's the Content-Type of the *response* <@fumanchu> looks like a bug; please file a ticket <VooDooNOFX> okie dokie <@fumanchu> to workaround, either turn off the logdebuginfofilter, patch it to assert Content-Type before split(), or find some way to fill in response.headers['Content-Type'] before CP gets to the logdebuginfofilter
Change History
05/25/08 17:23:26: Modified by fumanchu
- description changed.
- milestone changed from 3.0 to 2.3.
05/25/08 18:20:21: Modified by fumanchu
- status changed from new to closed.
- resolution set to fixed.


Fixed in [1972].