summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2026-09-08 17:21:13 -0700
committerRose Hogenson <rosehogenson@posteo.net>2026-09-08 17:24:27 -0700
commitbe5dc09014561e0825a75cfb3ba3631a9b9d25f4 (patch)
tree49ce9ccc2b341a7bd11c152ae1e09bf4f1459e62
parentSimplify the HTML templates by omitting end tags (diff)
downloadroseh.moe-be5dc09014561e0825a75cfb3ba3631a9b9d25f4.tar.zst
Use a different ETag for Content-Encoding gzip
Apparently this is required. Not sure if there's a less hacky way to do it.
-rw-r--r--roseh.moe.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/roseh.moe.go b/roseh.moe.go
index 094edfc..8654282 100644
--- a/roseh.moe.go
+++ b/roseh.moe.go
@@ -958,6 +958,9 @@ func (w *gzipResponseWriter) ReadFrom(r io.Reader) (int64, error) {
w.Header().Set("Content-Encoding", "gzip")
w.Header().Del("Content-Length")
w.Header().Del("Accept-Ranges")
+ if eTag := w.Header().Get("ETag"); eTag != "" {
+ w.Header().Set("ETag", strings.TrimSuffix(eTag, `"`)+`g"`)
+ }
}
if w.code != 0 {
w.ResponseWriter.WriteHeader(w.code)