Seaweed custom header are not visible to Vue or javascript

This commit is contained in:
henry 2021-01-05 12:58:46 +08:00
parent e4ee25e6f0
commit 1309dfe612

View file

@ -102,9 +102,9 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
//Add some custom headers that need to be exposed //Add some custom headers that need to be exposed
seaweedHeaders := []string{} seaweedHeaders := []string{}
for i, _ := range w.Header() { for header, _ := range w.Header() {
if strings.Contains(i, "Seaweed") { if strings.HasPrefix(header, "Seaweed-") {
seaweedHeaders = append(seaweedHeaders, i) seaweedHeaders = append(seaweedHeaders, header)
} }
} }
seaweedHeaders = append(seaweedHeaders, "Content-Disposition") seaweedHeaders = append(seaweedHeaders, "Content-Disposition")