diff options
-rw-r--r-- | src/libstore/binary-cache-store.cc | 2 | ||||
-rw-r--r-- | src/libstore/s3-binary-cache-store.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index d8e68fd58..25ad0d75b 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -224,7 +224,7 @@ void BinaryCacheStore::addToStore(const ValidPathInfo & info, const ref<std::str } } - upsertFile(storePathToHash(info.path) + ".ls.xz", *compress("xz", jsonOut.str()), "application/x-nix-nar-listing"); + upsertFile(storePathToHash(info.path) + ".ls", jsonOut.str(), "application/json"); } else { diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc index 5ecf3996d..3804e0b0f 100644 --- a/src/libstore/s3-binary-cache-store.cc +++ b/src/libstore/s3-binary-cache-store.cc @@ -267,9 +267,9 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore void upsertFile(const std::string & path, const std::string & data, const std::string & mimeType) override { - if (path.find(".narinfo") != std::string::npos) + if (textCompression != "" && (hasSuffix(path, ".narinfo") || hasSuffix(path, ".ls"))) uploadFile(path, *compress(textCompression, data), mimeType, textCompression); - else if (path.find("/log") != std::string::npos) + else if (logCompression != "" && hasPrefix(path, "log/")) uploadFile(path, *compress(logCompression, data), mimeType, logCompression); else uploadFile(path, data, mimeType, ""); |