﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22961	StaticFilesHandler should not run middleware on 404	Wil Tan	nobody	"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""."	Bug	closed	contrib.staticfiles	1.6	Normal	duplicate		Nicola	Accepted	1	0	1	0	0	0
