Browse Source

Merge pull request #1728 from fuyouyshengwu/master

Seaweed custom header are not visible to Vue or javascript
pull/1734/head
Chris Lu 4 years ago
committed by GitHub
parent
commit
eaac1a1393
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      weed/server/filer_server_handlers_read.go

10
weed/server/filer_server_handlers_read.go

@ -100,6 +100,16 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
w.Header().Set(k, string(v))
}
//Seaweed custom header are not visible to Vue or javascript
seaweedHeaders := []string{}
for header, _ := range w.Header() {
if strings.HasPrefix(header, "Seaweed-") {
seaweedHeaders = append(seaweedHeaders, header)
}
}
seaweedHeaders = append(seaweedHeaders, "Content-Disposition")
w.Header().Set("Access-Control-Expose-Headers", strings.Join(seaweedHeaders, ","))
//set tag count
if r.Method == "GET" {
tagCount := 0

Loading…
Cancel
Save