s3: avoid possible attacks by version

This commit is contained in:
Chris Lu 2021-11-08 17:47:29 -08:00
parent 5c99b8acc3
commit 59d1435d65

View file

@ -2,7 +2,6 @@ package s3api
import ( import (
stats_collect "github.com/chrislusf/seaweedfs/weed/stats" stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/util"
"net/http" "net/http"
"strconv" "strconv"
"time" "time"
@ -28,7 +27,7 @@ func (r *StatusRecorder) Flush() {
func track(f http.HandlerFunc, action string) http.HandlerFunc { func track(f http.HandlerFunc, action string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "SeaweedFS S3 "+util.VERSION) w.Header().Set("Server", "SeaweedFS S3")
recorder := NewStatusResponseWriter(w) recorder := NewStatusResponseWriter(w)
start := time.Now() start := time.Now()
f(recorder, r) f(recorder, r)