Commit ec27f419 authored by Steven Allen's avatar Steven Allen

fix: avoid filtering by prefix unless necessary

There's no need to filter by the / prefix.
parent b72ac7e0
......@@ -129,12 +129,10 @@ func NaiveQueryApply(q Query, qr Results) Results {
}
prefix = path.Clean(prefix)
}
// If the prefix isn't "/", end it in a "/" so we only find keys
// _under_ the prefix.
// If the prefix is empty, ignore it.
if prefix != "/" {
prefix += "/"
qr = NaiveFilter(qr, FilterKeyPrefix{prefix + "/"})
}
qr = NaiveFilter(qr, FilterKeyPrefix{prefix})
}
for _, f := range q.Filters {
qr = NaiveFilter(qr, f)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment