diff options
author | Fabio Barone <fabio.barone.co@gmail.com> | 2017-10-18 21:33:50 +0800 |
---|---|---|
committer | Fabio Barone <fabio.barone.co@gmail.com> | 2017-11-09 23:38:42 +0800 |
commit | 03ec3fed2b7363700571a83ef41de3ee9208d94e (patch) | |
tree | eb03477966740775f2d9ac7f55f4c3e58329a094 /swarm/api/manifest.go | |
parent | 3d88ecd61ae7b43f1227acafaec71e49093491b8 (diff) | |
download | go-tangerine-03ec3fed2b7363700571a83ef41de3ee9208d94e.tar go-tangerine-03ec3fed2b7363700571a83ef41de3ee9208d94e.tar.gz go-tangerine-03ec3fed2b7363700571a83ef41de3ee9208d94e.tar.bz2 go-tangerine-03ec3fed2b7363700571a83ef41de3ee9208d94e.tar.lz go-tangerine-03ec3fed2b7363700571a83ef41de3ee9208d94e.tar.xz go-tangerine-03ec3fed2b7363700571a83ef41de3ee9208d94e.tar.zst go-tangerine-03ec3fed2b7363700571a83ef41de3ee9208d94e.zip |
swarm/api: bug fix exact match for manifest
Diffstat (limited to 'swarm/api/manifest.go')
-rw-r--r-- | swarm/api/manifest.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go index d3eced198..5cd84e28e 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) |