flip signature, disabled by default

This commit is contained in:
Umputun
2021-04-13 14:08:15 -05:00
parent 510b29c3ec
commit 6dcc2fa719
4 changed files with 37 additions and 36 deletions

View File

@@ -24,18 +24,18 @@ import (
// Http is a proxy server for both http and https
type Http struct { // nolint golint
Matcher
Address string
AssetsLocation string
AssetsWebRoot string
MaxBodySize int64
GzEnabled bool
ProxyHeaders []string
SSLConfig SSLConfig
Version string
AccessLog io.Writer
StdOutEnabled bool
DisableSignature bool
Timeouts Timeouts
Address string
AssetsLocation string
AssetsWebRoot string
MaxBodySize int64
GzEnabled bool
ProxyHeaders []string
SSLConfig SSLConfig
Version string
AccessLog io.Writer
StdOutEnabled bool
Signature bool
Timeouts Timeouts
}
// Matcher source info (server and route) to the destination url
@@ -228,14 +228,14 @@ func (h *Http) gzipHandler() func(next http.Handler) http.Handler {
}
func (h *Http) signatureHandler() func(next http.Handler) http.Handler {
if h.DisableSignature {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
next.ServeHTTP(w, r)
})
}
if h.Signature {
return R.AppInfo("reproxy", "umputun", h.Version)
}
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
next.ServeHTTP(w, r)
})
}
return R.AppInfo("reproxy", "umputun", h.Version)
}
func (h *Http) accessLogHandler(wr io.Writer) func(next http.Handler) http.Handler {