aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/manifest.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-11-24 22:23:37 +0800
committerGitHub <noreply@github.com>2017-11-24 22:23:37 +0800
commitf0ac925fa760a3a681de673ec3687e84f6ee657e (patch)
tree4f9c30d4d475aa90cf0034cbe4512322c9b46abd /swarm/api/manifest.go
parent0981d2e566535e1351f7988d3586d2daeae895ec (diff)
parent03ec3fed2b7363700571a83ef41de3ee9208d94e (diff)
downloaddexon-f0ac925fa760a3a681de673ec3687e84f6ee657e.tar
dexon-f0ac925fa760a3a681de673ec3687e84f6ee657e.tar.gz
dexon-f0ac925fa760a3a681de673ec3687e84f6ee657e.tar.bz2
dexon-f0ac925fa760a3a681de673ec3687e84f6ee657e.tar.lz
dexon-f0ac925fa760a3a681de673ec3687e84f6ee657e.tar.xz
dexon-f0ac925fa760a3a681de673ec3687e84f6ee657e.tar.zst
dexon-f0ac925fa760a3a681de673ec3687e84f6ee657e.zip
Merge pull request #15329 from holisticode/exact-match-fix
swarm/api: bug fix exact match for manifest
Diffstat (limited to 'swarm/api/manifest.go')
-rw-r--r--swarm/api/manifest.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go
index 32b5f80a7..685a300fc 100644
--- a/swarm/api/manifest.go
+++ b/swarm/api/manifest.go
@@ -436,6 +436,16 @@ func (self *manifestTrie) findPrefixOf(path string, quitC chan bool) (entry *man
if len(path) <= epl {
if entry.Path[:len(path)] == path {
if entry.ContentType == ManifestType {
+ err := self.loadSubTrie(entry, quitC)
+ if err == nil && entry.subtrie != nil {
+ subentries := entry.subtrie.entries
+ for i := 0; i < len(subentries); i++ {
+ sub := subentries[i]
+ if sub != nil && sub.Path == "" {
+ return sub, len(path)
+ }
+ }
+ }
entry.Status = http.StatusMultipleChoices
}
pos = len(path)