]> Cypherpunks repositories - gostls13.git/commit
net/http: ignore the Unix epoch time in ServeContent
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 12 Feb 2015 16:42:11 +0000 (08:42 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 23 Mar 2015 02:16:56 +0000 (02:16 +0000)
commita0fb8f8cce1d3b239f83c198204b616aab136510
treeed872522f9dd598fa94d9cff50e3e31ea92355d9
parent25bf792197ff737fc84c8b1dd46be8a6b066333a
net/http: ignore the Unix epoch time in ServeContent

ServeContent ignored zero time.Time{} values when generating
Last-Modified response headers and checking If-Modified-Since request
headers. Do the same for a time.Time representing the Unix epoch zero
value, as this is a common bogus value. Callers who really want to
send that value (incredibly unlikely) can add a nanosecond to it and
it will be truncated to second granularity anyway.

Fixes #9842

Change-Id: I69f697bfc4017404a92a34e3fe57e2711c1e299d
Reviewed-on: https://go-review.googlesource.com/7915
Reviewed-by: David Symonds <dsymonds@golang.org>
src/net/http/fs.go
src/net/http/fs_test.go