Avoid xattr printed out as HTTP headers

fix https://github.com/chrislusf/seaweedfs/issues/2336
This commit is contained in:
Chris Lu
2021-09-13 04:00:57 -07:00
parent 96514f0f00
commit 7504be58f9
2 changed files with 17 additions and 7 deletions

View File

@@ -97,7 +97,10 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
// print out the header from extended properties
for k, v := range entry.Extended {
w.Header().Set(k, string(v))
if !strings.HasPrefix(k, "xattr-") {
// "xattr-" prefix is set in filesys.XATTR_PREFIX
w.Header().Set(k, string(v))
}
}
//Seaweed custom header are not visible to Vue or javascript