Browse Source

Merge pull request #236 from JustAnotherArchivist/fix-filename-spaces

Fix encoding of spaces in filenames from + to %20
tags/v1.1.0
Andrea Spacca 5 years ago
committed by GitHub
parent
commit
7d5611da94
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      server/handlers.go

+ 2
- 2
server/handlers.go View File

@@ -328,7 +328,7 @@ func (s *Server) postHandler(w http.ResponseWriter, r *http.Request) {


} }


filename = url.QueryEscape(filename)
filename = url.PathEscape(filename)
relativeURL, _ := url.Parse(path.Join(s.proxyPath, token, filename)) relativeURL, _ := url.Parse(path.Join(s.proxyPath, token, filename))
fmt.Fprintln(w, getURL(r).ResolveReference(relativeURL).String()) fmt.Fprintln(w, getURL(r).ResolveReference(relativeURL).String())


@@ -487,7 +487,7 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) {


w.Header().Set("Content-Type", "text/plain") w.Header().Set("Content-Type", "text/plain")


filename = url.QueryEscape(filename)
filename = url.PathEscape(filename)
relativeURL, _ := url.Parse(path.Join(s.proxyPath, token, filename)) relativeURL, _ := url.Parse(path.Join(s.proxyPath, token, filename))
deleteURL, _ := url.Parse(path.Join(s.proxyPath, token, filename, metadata.DeletionToken)) deleteURL, _ := url.Parse(path.Join(s.proxyPath, token, filename, metadata.DeletionToken))




Loading…
Cancel
Save