diff --git a/Makefile b/Makefile index 07695ee..baa74fc 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,10 @@ SOURCES:=Makefile \ cmd $(wildcard cmd/yatwiki-server/*.go) \ $(wildcard *.go) -GOFLAGS := -ldflags='-s -w' -gcflags='-trimpath=$(GOPATH)' -asmflags='-trimpath=$(GOPATH)' +GOFLAGS:=-a \ + -ldflags "-s -w -X code.ivysaur.me/yatwiki.SERVER_HEADER=YATWiki/$(VERSION)" \ + -gcflags '-trimpath=$(GOPATH)' \ + -asmflags '-trimpath=$(GOPATH)' # # Phony targets diff --git a/WikiServer.go b/WikiServer.go index 8937aba..effd1d9 100644 --- a/WikiServer.go +++ b/WikiServer.go @@ -14,6 +14,8 @@ import ( "time" ) +var SERVER_HEADER string = "YATWiki/0.0.0-devel" + type WikiServer struct { db *WikiDB opts *ServerOptions @@ -79,7 +81,7 @@ func (this *WikiServer) Close() { } func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Server", "YATWiki3") + w.Header().Set("Server", SERVER_HEADER) if len(this.bans) > 0 { remoteIP := RemoteAddrToIPAddress(r.RemoteAddr)