about summary refs log tree commit diff stats
path: root/cmd/server/server.go
diff options
context:
space:
mode:
authorAlan Pearce2024-04-25 02:09:40 +0200
committerAlan Pearce2024-04-25 02:09:40 +0200
commitb27825139e77cd8c527ada7c712f186c94444c04 (patch)
tree9761092548819868f3e06bcf15ef3c373dc00046 /cmd/server/server.go
parentac9646a38aaa39ca9cb7e0aa2efa370e463abaa0 (diff)
downloadwebsite-b27825139e77cd8c527ada7c712f186c94444c04.tar.lz
website-b27825139e77cd8c527ada7c712f186c94444c04.tar.zst
website-b27825139e77cd8c527ada7c712f186c94444c04.zip
brand exe with both long and short commit hashes
Diffstat (limited to 'cmd/server/server.go')
-rw-r--r--cmd/server/server.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd/server/server.go b/cmd/server/server.go
index 10144bb..9a1e48a 100644
--- a/cmd/server/server.go
+++ b/cmd/server/server.go
@@ -19,8 +19,6 @@ import (
 	"github.com/shengyanli1982/law"
 )
 
-var Commit string
-
 var config *cfg.Config
 
 type HTTPError struct {
@@ -71,7 +69,7 @@ func (fn webHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 			slog.Error("runtime panic!", "error", fail)
 		}
 	}()
-	w.Header().Set("Server", fmt.Sprintf("website (%s)", Commit))
+	w.Header().Set("Server", fmt.Sprintf("website (%s)", ShortSHA))
 	if err := fn(w, r); err != nil {
 		if strings.Contains(r.Header.Get("Accept"), "text/html") {
 			w.WriteHeader(err.Code)
@@ -119,7 +117,7 @@ func startServer(runtimeConfig *Config) {
 		EnableTracing:    true,
 		TracesSampleRate: 1.0,
 		Dsn:              os.Getenv("SENTRY_DSN"),
-		Release:          Commit,
+		Release:          CommitSHA,
 		Environment:      env,
 	})
 	if err != nil {