swarm/api: fixed 404 handling on missing default entry (#15139)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user