From 58adc88651873c86ca9b95e087a87b0897efa759 Mon Sep 17 00:00:00 2001 From: Peter Csajtai Date: Tue, 25 Jul 2023 17:28:35 +0200 Subject: [PATCH] Return etag from configcattest handler --- configcattest/handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configcattest/handler.go b/configcattest/handler.go index 5bd1f01..a3458ef 100644 --- a/configcattest/handler.go +++ b/configcattest/handler.go @@ -4,6 +4,7 @@ package configcattest import ( "crypto/rand" + "crypto/sha1" "encoding/base64" "encoding/json" "fmt" @@ -34,6 +35,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) { return } w.Header().Set("Content-Type", "application/json") + w.Header().Set("ETag", fmt.Sprintf("%x", sha1.Sum(content))) w.Write(content) }