mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 03:01:48 +00:00
Add a Server: header unconditionally.
Previously we wouldn't do it if hostname could not be determined, which would break git-pages-cli based uploads on those machines.
This commit is contained in:
@@ -862,6 +862,8 @@ func ServePages(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Add("Server", fmt.Sprintf("git-pages (%s)", hostname))
|
||||
ObserveData(r.Context(), "server.name", hostname)
|
||||
}
|
||||
} else {
|
||||
w.Header().Add("Server", "git-pages")
|
||||
}
|
||||
allowedMethods := []string{"OPTIONS", "HEAD", "GET", "PUT", "PATCH", "DELETE", "POST"}
|
||||
if r.Method == "OPTIONS" || !slices.Contains(allowedMethods, r.Method) {
|
||||
|
||||
Reference in New Issue
Block a user