about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-06-05T12·44+0200
committerEelco Dolstra <edolstra@gmail.com>2018-06-05T13·26+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 9a2d0dafa518..c7cffedbadc8 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)