Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix: add ETag header for bot/scraper page. For #4020

Gabe Kangas29d1cc18995c
diff --git a/webserver/handlers/index.go b/webserver/handlers/index.go
index 5fa7e9c0ee..fb75c29828 100644
--- a/webserver/handlers/index.go
+++ b/webserver/handlers/index.go
@@ -2,6 +2,7 @@ package handlers
import (
"bytes"
+ "crypto/md5" // nolint:gosec
"encoding/json"
"fmt"
"net/http"
@@ -199,7 +200,7 @@ func handleScraperMetadataPage(w http.ResponseWriter, r *http.Request) {
// Set a cache header
middleware.SetCachingHeaders(w, r)
-
+ w.Header().Set("ETag", fmt.Sprintf("%x", md5.Sum(b.Bytes()))) // nolint:gosec
w.Header().Set("Content-Type", "text/html")
if _, err = w.Write(b.Bytes()); err != nil {
log.Errorln(err)