Merge pull request #15329 from holisticode/exact-match-fix

swarm/api: bug fix exact match for manifest
This commit is contained in:
Péter Szilágyi
2017-11-24 16:23:37 +02:00
committed by GitHub
2 changed files with 61 additions and 27 deletions

View File

@ -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)