[web/application] declare default 'content' value sooner (closes #2406560)
It may be used while processing AuthenticationError. Such error may be raised
before the former declaration.
--- a/web/application.py Wed Jun 13 10:06:11 2012 +0200
+++ b/web/application.py Thu Jun 14 15:55:03 2012 +0200
@@ -348,6 +348,7 @@
# activate realm-based auth
realm = self.vreg.config['realm']
req.set_header('WWW-Authenticate', [('Basic', {'realm' : realm })], raw=False)
+ content = ''
try:
self.connect(req)
# DENY https acces for anonymous_user
@@ -356,7 +357,6 @@
and self.vreg.config['https-deny-anonymous']):
# don't allow anonymous on https connection
raise AuthenticationError()
- content = ''
# nested try to allow LogOut to delegate logic to AuthenticationError
# handler
try: