aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-06-05 14:44:26 +0200
committerEelco Dolstra <edolstra@gmail.com>2018-06-05 15:26:12 +0200
commitca06a9cea706bf06374efeed276cf3a90d2eaa80 (patch)
tree16d1ae7e65eab6b77d186af2b9c9ac634a254584 /src
parenta2ec7a3bfd33a4792185a74e2ae20b48f7ac2de9 (diff)
Improve binary cache fallback test
Diffstat (limited to 'src')
-rw-r--r--src/libstore/download.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 9a2d0dafa..c7cffedba 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -574,6 +574,11 @@ struct CurlDownloader : public Downloader
void enqueueItem(std::shared_ptr<DownloadItem> item)
{
+ if (item->request.data
+ && !hasPrefix(item->request.uri, "http://")
+ && !hasPrefix(item->request.uri, "https://"))
+ throw nix::Error("uploading to '%s' is not supported", item->request.uri);
+
{
auto state(state_.lock());
if (state->quit)