﻿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
18675	If-modified-since for static resources not working.	Piotr Czachur	Simon Charette	"== How to reproduce ==
1. Enable serving static files.
2. Request same file multiple times.
3. You always get HTTP ""200"", but it should be ""304"" after first request.


== What causes the problem ==
django.views.static.was_modified_since() compares modification time taken from two sources:
 - os.stat()
 - HTTP_IF_MODIFIED_SINCE header.

os.stat() returns timestamp as float (Linux 64bit), and header contains integer timestamp, which results in such comparsions for unmodified files:
{{{
if 1331113576.68 > 1331113576:
     // assuming file was modified
}}}
which have incorrect result.

was_modified_since() should refuse comparing values of different types, or cast both to integers.

Notice that values returned by os.stat() can be OS-dependent.
"	Bug	closed	HTTP handling	dev	Normal	fixed	static serve	charette.s@…	Ready for checkin	1	0	0	0	1	0
