cmd: print current version name on cmd and Via header

This commit is contained in:
WeebDataHoarder
2025-04-23 20:44:51 +02:00
parent 57755112ea
commit cb02fb20e9
3 changed files with 19 additions and 7 deletions
+3 -2
View File
@@ -179,8 +179,9 @@ func (state *State) ServeHTTP(w http.ResponseWriter, r *http.Request) {
data.EvaluateChallenges(w, r)
// TODO: make this configurable!
w.Header().Add("Via", fmt.Sprintf("%s %s", r.Proto, "go-away"))
if state.Settings().MainName != "" {
w.Header().Add("Via", fmt.Sprintf("%s %s@%s", r.Proto, state.Settings().MainName, state.Settings().MainVersion))
}
state.Mux.ServeHTTP(w, r)
}
+2
View File
@@ -10,6 +10,8 @@ type Settings struct {
Backends map[string]http.Handler
PrivateKeySeed []byte
Debug bool
MainName string
MainVersion string
PackageName string
ChallengeTemplate string
ChallengeTemplateTheme string