mitsuhiko/flask — Issue #405: Favicon request pops request context in debugger
Author: pgega
Created: 2012-02-21 13:05:40+00:00
State: open

```
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).