Skip to content

Commit

Permalink
Return etag from configcattest handler
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Jul 25, 2023
1 parent 243a98f commit 58adc88
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configcattest/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package configcattest

import (
"crypto/rand"
"crypto/sha1"
"encoding/base64"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 58adc88

Please sign in to comment.