Fix purging default file from HTTP cache
This commit is contained in:
parent
48678fb4c6
commit
6eefa5ca2b
@ -90,6 +90,13 @@ func (h *FSHandler) PutFile(c echo.Context) error {
|
||||
|
||||
if h.fs.Cache != nil {
|
||||
h.fs.Cache.Delete(path)
|
||||
|
||||
if len(h.fs.DefaultFile) != 0 {
|
||||
if strings.HasSuffix(path, "/"+h.fs.DefaultFile) {
|
||||
path := strings.TrimSuffix(path, h.fs.DefaultFile)
|
||||
h.fs.Cache.Delete(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c.Response().Header().Set("Content-Location", req.URL.RequestURI())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user