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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
0 deletions
-
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 |
|
|
|