|
|
@@ -321,7 +321,7 @@ func (s *Server) postHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
filename = url.QueryEscape(filename) |
|
|
|
filename = url.PathEscape(filename) |
|
|
|
relativeURL, _ := url.Parse(path.Join(token, filename)) |
|
|
|
fmt.Fprintln(w, getURL(r).ResolveReference(relativeURL).String()) |
|
|
|
|
|
|
@@ -480,7 +480,7 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
w.Header().Set("Content-Type", "text/plain") |
|
|
|
|
|
|
|
filename = url.QueryEscape(filename) |
|
|
|
filename = url.PathEscape(filename) |
|
|
|
relativeURL, _ := url.Parse(path.Join(token, filename)) |
|
|
|
deleteUrl, _ := url.Parse(path.Join(token, filename, metadata.DeletionToken)) |
|
|
|
|
|
|
@@ -556,9 +556,10 @@ func (s *Server) CheckMetadata(token, filename string) error { |
|
|
|
var metadata Metadata |
|
|
|
|
|
|
|
r, _, _, err := s.storage.Get(token, fmt.Sprintf("%s.metadata", filename)) |
|
|
|
if s.storage.IsNotExist(err) { |
|
|
|
return nil |
|
|
|
} else if err != nil { |
|
|
|
//if s.storage.IsNotExist(err) { |
|
|
|
// return nil |
|
|
|
//} else if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|