Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Favicon request pops request context in debugger #405

Closed
pgega opened this Issue Feb 21, 2012 · 2 comments

Comments

Projects
None yet
2 participants

pgega commented Feb 21, 2012

127.0.0.1 - - [21/Feb/2012 12:36:49] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1518, in __call__
    return self.wsgi_app(environ, start_response)
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1506, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1504, in wsgi_app
    response = self.full_dispatch_request()
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1264, in full_dispatch_
    rv = self.handle_user_exception(e)
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1262, in full_dispatch_
    rv = self.dispatch_request()
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1248, in dispatch_reque
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/tmp/t.py", line 8, in test
    raise Exception
Exception
127.0.0.1 - - [21/Feb/2012 12:36:49] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:36:49] "GET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:36:49] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:36:49] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:36:49] "GET /?__debugger__=yes&cmd=resource&f=source.png HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:36:49] "GET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:36:49] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [21/Feb/2012 12:37:03] "GET /?__debugger__=yes&cmd=dump(request)&frm=13152656&s=EYoKchPnHhuZ75RuzgrG HTTP
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1518, in __call__
    return self.wsgi_app(environ, start_response)
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1506, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1504, in wsgi_app
    response = self.full_dispatch_request()
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1264, in full_dispatch_
    rv = self.handle_user_exception(e)
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1262, in full_dispatch_
    rv = self.dispatch_request()
  File "/tmp/python2.7/lib/python2.7/site-packages/flask/app.py", line 1248, in dispatch_reque
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/tmp/t.py", line 8, in test
    raise Exception
Exception
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET /?__debugger__=yes&cmd=resource&f=source.png HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2012 12:37:05] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [21/Feb/2012 12:37:11] "GET /?__debugger__=yes&cmd=dump(request)&frm=16515728&s=EYoKchPnHhuZ75RuzgrG HTTP
127.0.0.1 - - [21/Feb/2012 12:37:47] "GET /?__debugger__=yes&cmd=source&frm=16515728&s=EYoKchPnHhuZ75RuzgrG HTTP/1.1" 2
127.0.0.1 - - [21/Feb/2012 12:58:50] "GET /?__debugger__=yes&cmd=source&frm=16515728&s=EYoKchPnHhuZ75RuzgrG HTTP/1.1" 200 -

Chromium constantly requests favicon (http://code.google.com/p/chromium/issues/detail?id=39402) - hence the request context is cleared on every request to debugger.

This is not an issue on Firefox (as it caches 404 response).

Owner

mitsuhiko commented Feb 22, 2012

That's quite hairy. I have not yet found a good solution but as a quick workaround for other people that have this problem: add a WSGI middleware that returns something for /favicon.ico

Owner

mitsuhiko commented Feb 22, 2012

This got fixed in Werkzeug-dev now by adding a favicon to the debugger. This prevents chrome from looking for one. Update to Werkzeug-0.9-dev which is on master or 0.8.4-dev which is on 0.8-maintenance.

@mitsuhiko mitsuhiko closed this Feb 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment