move server version setting to common section

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-05-01 19:42:09 +02:00
parent 7b5ad6c38d
commit d3f42e39db
22 changed files with 86 additions and 91 deletions

View File

@@ -16,7 +16,6 @@ package httpd
import (
"errors"
"fmt"
"net/http"
"strings"
@@ -118,11 +117,10 @@ func hasPrefixAndSuffix(key, prefix, suffix string) bool {
}
func getCommonBasePage(r *http.Request) commonBasePage {
v := version.Get()
return commonBasePage{
CSPNonce: secure.CSPNonce(r.Context()),
StaticURL: webStaticFilesPath,
Version: fmt.Sprintf("v%v-%v", v.Version, v.CommitHash),
Version: version.GetServerVersion(" ", true),
}
}