fixes #1
Dieser Commit ist enthalten in:
Ursprung
03b6c3d059
Commit
e47609087f
|
@ -21,10 +21,10 @@ func headheader(f fs.File, c *gin.Context) (nocontent bool) {
|
||||||
}
|
}
|
||||||
c.Writer.Header().Set("Last-Modified", stats.ModTime().Format(time.RFC1123))
|
c.Writer.Header().Set("Last-Modified", stats.ModTime().Format(time.RFC1123))
|
||||||
if t, err := time.Parse(time.RFC1123, c.GetHeader("If-Modified-Since")); stats.ModTime().After(t) && err == nil {
|
if t, err := time.Parse(time.RFC1123, c.GetHeader("If-Modified-Since")); stats.ModTime().After(t) && err == nil {
|
||||||
nocontent = true
|
|
||||||
}
|
|
||||||
if nocontent {
|
|
||||||
c.Status(http.StatusNotModified)
|
c.Status(http.StatusNotModified)
|
||||||
|
nocontent = true
|
||||||
|
} else {
|
||||||
|
c.Status(http.StatusOK)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Laden…
In neuem Issue referenzieren