[web/application] declare default 'content' value sooner (closes #2406560)
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 14 Jun 2012 15:55:03 +0200
changeset 8443 86fc11fb6f99
parent 8442 202625f247b4
child 8444 7a861620f64f
[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.
web/application.py
--- 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: