From 1309dfe612ae818134d2241c38fc3858516ea729 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 5 Jan 2021 12:58:46 +0800 Subject: [PATCH] Seaweed custom header are not visible to Vue or javascript --- weed/server/filer_server_handlers_read.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index 28027a009..46a7ca9d9 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -102,9 +102,9 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, //Add some custom headers that need to be exposed seaweedHeaders := []string{} - for i, _ := range w.Header() { - if strings.Contains(i, "Seaweed") { - seaweedHeaders = append(seaweedHeaders, i) + for header, _ := range w.Header() { + if strings.HasPrefix(header, "Seaweed-") { + seaweedHeaders = append(seaweedHeaders, header) } } seaweedHeaders = append(seaweedHeaders, "Content-Disposition")