mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 21:53:48 +03:00
encode: Slight fix for the previous commit
This commit is contained in:
parent
3067074d9c
commit
9ab09433de
1 changed files with 5 additions and 2 deletions
|
@ -164,8 +164,11 @@ func (enc *Encode) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyh
|
||||||
// we have to strip our addition so the upstream handlers can still honor client
|
// we have to strip our addition so the upstream handlers can still honor client
|
||||||
// caches without knowing about our changes...
|
// caches without knowing about our changes...
|
||||||
if etag := r.Header.Get("If-None-Match"); etag != "" && !strings.HasPrefix(etag, "W/") {
|
if etag := r.Header.Get("If-None-Match"); etag != "" && !strings.HasPrefix(etag, "W/") {
|
||||||
etag = strings.TrimSuffix(etag, "-"+encName+`"`) + `"`
|
ourSuffix := "-" + encName + `"`
|
||||||
r.Header.Set("If-None-Match", etag)
|
if strings.HasSuffix(etag, ourSuffix) {
|
||||||
|
etag = strings.TrimSuffix(etag, ourSuffix) + `"`
|
||||||
|
r.Header.Set("If-None-Match", etag)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue