Skip to content

Commit

Permalink
Added server header
Browse files Browse the repository at this point in the history
  • Loading branch information
akclace committed Jan 15, 2025
1 parent 568de5d commit d308b7f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
VARY_HEADER = "Vary"
DRY_RUN_ARG = "dryRun"
PROMOTE_ARG = "promote"
SERVER_NAME = "Clace"
)

var (
Expand Down Expand Up @@ -166,6 +167,7 @@ func (h *Handler) httpsRedirectMiddleware(next http.Handler) http.Handler {
}

// Redirect to the HTTPS version of the URL
w.Header().Add("Server", SERVER_NAME)
http.Redirect(w, r, u.String(), http.StatusPermanentRedirect) // 308 (301 does not keep method)
return
}
Expand Down Expand Up @@ -681,6 +683,7 @@ func AddVaryHeader(next http.Handler) http.Handler {
}

w.Header().Add(VARY_HEADER, value)
w.Header().Add("Server", SERVER_NAME)
next.ServeHTTP(w, r)
}
return http.HandlerFunc(fn)
Expand Down

0 comments on commit d308b7f

Please sign in to comment.