[Django] #22961: StaticFilesHandler should not run middleware on 404

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #22961: StaticFilesHandler should not run middleware on 404

Django
#22961: StaticFilesHandler should not run middleware on 404
-------------------------------------+--------------------
     Reporter:  dready               |      Owner:  nobody
         Type:  Bug                  |     Status:  new
    Component:  contrib.staticfiles  |    Version:  1.6
     Severity:  Normal               |   Keywords:
 Triage Stage:  Unreviewed           |  Has patch:  1
Easy pickings:  0                    |      UI/UX:  0
-------------------------------------+--------------------
 When the staticfiles WSGI handler determines that it should handle a given
 path, but caught a 404 exception, it should not chain to the parent
 WSGIHandler, but immediately return a response.

 Otherwise, we would find that middleware gets run. This may have undesired
 side effects. In our case, we were running a selenium test
 (LiveServerTestCase) and got session invalidated due to a concurrent
 request to login and a static file that does not exist (because this
 latter one went through the session middleware.)

 I realise that the LiveServerTestCase code has changed in Django 1.7
 (which duplicated some of the code in StaticFilesHandler as
 django.test.testcases.FSFilesHandler)

 The proposed patch is only for the StaticFilesHandler. I would like to
 hear from others what they think of this "fix".

--
Ticket URL: <https://code.djangoproject.com/ticket/22961>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/049.0a8bf724a6e0db748cab914019d2fe6f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #22961: StaticFilesHandler should not run middleware on 404

Django
#22961: StaticFilesHandler should not run middleware on 404
-------------------------------------+------------------------------------
     Reporter:  dready               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  1.6
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------
Changes (by timo):

 * needs_better_patch:   => 0
 * stage:  Unreviewed => Accepted
 * needs_tests:   => 1
 * needs_docs:   => 0


Comment:

 The patch makes sense to me. A test would also be required.

--
Ticket URL: <https://code.djangoproject.com/ticket/22961#comment:1>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.38402c59cc57287e56ca96ea3aa1ba48%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #22961: StaticFilesHandler should not run middleware on 404

Django
In reply to this post by Django
#22961: StaticFilesHandler should not run middleware on 404
-------------------------------------+------------------------------------
     Reporter:  Wil Tan              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  1.6
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------
Changes (by Nicola):

 * cc: Nicola (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/22961#comment:2>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.f257a9f6b5d609cbbeb3bd4c66b3f47d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #22961: StaticFilesHandler should not run middleware on 404

Django
In reply to this post by Django
#22961: StaticFilesHandler should not run middleware on 404
-------------------------------------+-------------------------------------
     Reporter:  Wil Tan              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  1.6
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 I think that #29353 was a duplicate. It was recently fixed and should be
 in Django 2.1.

--
Ticket URL: <https://code.djangoproject.com/ticket/22961#comment:3>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.bc3290814e880f70b31ea6ef5c8f0763%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.