Skip to content

Commit 2cb2a8e

Browse files
edolstraclaude
andcommitted
bloom filter: support absolute BloomFilter URLs
This is already handled correctly in HttpBinaryCacheStore::makeRequest(), so we can just drop the check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent aaaac87 commit 2cb2a8e

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

src/libstore/binary-cache-store.cc

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,13 @@ bool BinaryCacheStore::isDefinitelyMissing(const StorePath & storePath) noexcept
146146
}
147147

148148
if (!haveMeta) {
149-
const auto & url = *bloomFilterUrl;
150-
if (hasPrefix(url, "http://") || hasPrefix(url, "https://")) {
151-
warn(
152-
"Bloom filter at absolute URL '%s' is not yet supported; disabling Bloom filter for cache '%s'",
153-
url,
154-
uri);
155-
bloomState.lock()->status = BloomState::Disabled;
156-
return false;
157-
}
158-
std::string path = url;
159-
while (!path.empty() && path[0] == '/')
160-
path.erase(0, 1);
161-
149+
/* `*bloomFilterUrl` can be a full (absolute) URL or a path
150+
relative to the cache root; either way the resolution is
151+
done by `getFile()` / `makeRequest()`, the same as for NAR
152+
URLs in `.narinfo` files. */
162153
ConditionalGetResult res;
163154
try {
164-
res = getFileConditional(path, expectedETag);
155+
res = getFileConditional(*bloomFilterUrl, expectedETag);
165156
} catch (Error & e) {
166157
warn("failed to fetch Bloom filter from cache '%s': %s; disabling for this process", uri, e.message());
167158
bloomState.lock()->status = BloomState::Disabled;

0 commit comments

Comments
 (0)