Browse Source

rename

pull/1479/head
Chris Lu 5 years ago
parent
commit
3faa0aa448
  1. 2
      weed/server/common.go
  2. 2
      weed/server/filer_server_handlers_read.go
  3. 2
      weed/server/volume_server_handlers_read.go

2
weed/server/common.go

@ -218,7 +218,7 @@ func handleStaticResources2(r *mux.Router) {
r.PathPrefix("/seaweedfsstatic/").Handler(http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
}
func adjustHeaders(w http.ResponseWriter, r *http.Request, filename string) {
func adjustHeaderContentDisposition(w http.ResponseWriter, r *http.Request, filename string) {
if filename != "" {
contentDisposition := "inline"
if r.FormValue("dl") != "" {

2
weed/server/filer_server_handlers_read.go

@ -102,7 +102,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
setEtag(w, etag)
filename := entry.Name()
adjustHeaders(w, r, filename)
adjustHeaderContentDisposition(w, r, filename)
if r.Method == "HEAD" {
w.Header().Set("Content-Length", strconv.FormatInt(int64(filer2.TotalSize(entry.Chunks)), 10))

2
weed/server/volume_server_handlers_read.go

@ -244,7 +244,7 @@ func writeResponseContent(filename, mimeType string, rs io.ReadSeeker, w http.Re
}
w.Header().Set("Accept-Ranges", "bytes")
adjustHeaders(w, r, filename)
adjustHeaderContentDisposition(w, r, filename)
if r.Method == "HEAD" {
w.Header().Set("Content-Length", strconv.FormatInt(totalSize, 10))

Loading…
Cancel
Save