aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/api.go
diff options
context:
space:
mode:
authorholisticode <holistic.computing@gmail.com>2017-10-06 21:45:54 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-10-06 21:45:54 +0800
commit1ae0411d419d2178727048021f8dc09b6ccd1d82 (patch)
treee1958ecbcad5581d27c56afd5c03258309e19861 /swarm/api/api.go
parentd54e3539d453c78e30d950706f6465743723a33c (diff)
downloaddexon-1ae0411d419d2178727048021f8dc09b6ccd1d82.tar
dexon-1ae0411d419d2178727048021f8dc09b6ccd1d82.tar.gz
dexon-1ae0411d419d2178727048021f8dc09b6ccd1d82.tar.bz2
dexon-1ae0411d419d2178727048021f8dc09b6ccd1d82.tar.lz
dexon-1ae0411d419d2178727048021f8dc09b6ccd1d82.tar.xz
dexon-1ae0411d419d2178727048021f8dc09b6ccd1d82.tar.zst
dexon-1ae0411d419d2178727048021f8dc09b6ccd1d82.zip
swarm/api: fixed 404 handling on missing default entry (#15139)
Diffstat (limited to 'swarm/api/api.go')
-rw-r--r--swarm/api/api.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/swarm/api/api.go b/swarm/api/api.go
index a5941fb5c..79de29a1c 100644
--- a/swarm/api/api.go
+++ b/swarm/api/api.go
@@ -144,9 +144,13 @@ func (self *Api) Get(key storage.Key, path string) (reader storage.LazySectionRe
if entry != nil {
key = common.Hex2Bytes(entry.Hash)
status = entry.Status
- mimeType = entry.ContentType
- log.Trace(fmt.Sprintf("content lookup key: '%v' (%v)", key, mimeType))
- reader = self.dpa.Retrieve(key)
+ if status == http.StatusMultipleChoices {
+ return
+ } else {
+ mimeType = entry.ContentType
+ log.Trace(fmt.Sprintf("content lookup key: '%v' (%v)", key, mimeType))
+ reader = self.dpa.Retrieve(key)
+ }
} else {
status = http.StatusNotFound
err = fmt.Errorf("manifest entry for '%s' not found", path)