aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/http
diff options
context:
space:
mode:
authorJanoš Guljaš <janos@users.noreply.github.com>2018-08-10 22:12:55 +0800
committerBalint Gabor <balint.g@gmail.com>2018-08-10 22:12:55 +0800
commit6d1e292eefa70b5cb76cd03ff61fc6c4550d7c36 (patch)
tree3bcd5ab444bd7486a9011656c85baeee00216286 /swarm/api/http
parent3ec5dda4d2dd0dec6d5bd465752f30e8f6ce208c (diff)
downloaddexon-6d1e292eefa70b5cb76cd03ff61fc6c4550d7c36.tar.gz
dexon-6d1e292eefa70b5cb76cd03ff61fc6c4550d7c36.tar.zst
dexon-6d1e292eefa70b5cb76cd03ff61fc6c4550d7c36.zip
Manifest cli fix and upload defaultpath only once (#17375)
* cmd/swarm: fix manifest subcommands and add tests * cmd/swarm: manifest update: update default entry for non-encrypted uploads * swarm/api: upload defaultpath file only once * swarm/api/client: improve UploadDirectory default path handling * cmd/swarm: support absolute and relative default path values * cmd/swarm: fix a typo in test * cmd/swarm: check encrypted uploads in manifest update tests
Diffstat (limited to 'swarm/api/http')
-rw-r--r--swarm/api/http/server.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go
index bd6949de6..5a5c42adc 100644
--- a/swarm/api/http/server.go
+++ b/swarm/api/http/server.go
@@ -336,7 +336,9 @@ func (s *Server) HandlePostFiles(w http.ResponseWriter, r *http.Request) {
func (s *Server) handleTarUpload(r *http.Request, mw *api.ManifestWriter) (storage.Address, error) {
log.Debug("handle.tar.upload", "ruid", GetRUID(r.Context()))
- key, err := s.api.UploadTar(r.Context(), r.Body, GetURI(r.Context()).Path, mw)
+ defaultPath := r.URL.Query().Get("defaultpath")
+
+ key, err := s.api.UploadTar(r.Context(), r.Body, GetURI(r.Context()).Path, defaultPath, mw)
if err != nil {
return nil, err
}