#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:
  middleware_chain                   |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by koxu1996):

 l probably figured it out: just compare load_middleware() in BaseHandler
 and StaticFilesHandler. The former is setting _middleware_chain property,
 but second does not do anything:

 {{{
 class StaticFilesHandler(WSGIHandler):
 ...
     def load_middleware(self):
         # Middleware are already loaded for self.application; no need to
 reload
         # them for self.
         pass
 }}}
 I see two possible solutions:
 - set _middleware_chain in StaticFilesHandler.load_middleware()
 - check if _middleware_chain is not empty before calling it

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.f3083c596b42dd09f4b2f2a687c1cb5d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to