about summary refs log tree commit diff
path: root/src/libstore/download.hh
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-01-26T19·12-0800
committerShea Levy <shea@shealevy.com>2018-01-26T19·12-0800
commit1d5d277ac7bf8a4bc601358b38746005416e935e (patch)
treeb25687daa670e2d3605d99fe4761b9953e82c9de /src/libstore/download.hh
parente09161d05cfbd7c6d4cf41a35765e3fe346ea181 (diff)
HttpBinaryCacheStore: Support upsertFile with PUT.
Some servers, such as Artifactory, allow uploading with PUT and BASIC
auth. This allows nix copy to work to upload binaries to those
servers.

Worked on together with @adelbertc
Diffstat (limited to 'src/libstore/download.hh')
-rw-r--r--src/libstore/download.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index f2d65ad8d61d..0a278a05e0e1 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -18,9 +18,11 @@ struct DownloadRequest
     unsigned int baseRetryTimeMs = 250;
     ActivityId parentAct;
     bool decompress = true;
+    std::shared_ptr<std::string> data;
+    std::string mimeType;
 
-    DownloadRequest(const std::string & uri)
-        : uri(uri), parentAct(curActivity) { }
+    DownloadRequest(const std::string & uri, std::shared_ptr<std::string> data = nullptr, std::string mimeType = "")
+        : uri(uri), parentAct(curActivity), data(std::move(data)), mimeType(std::move(mimeType)) { }
 };
 
 struct DownloadResult