diff options
author | Shea Levy <shea@shealevy.com> | 2018-01-26T19·12-0800 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2018-01-26T19·12-0800 |
commit | 1d5d277ac7bf8a4bc601358b38746005416e935e (patch) | |
tree | b25687daa670e2d3605d99fe4761b9953e82c9de /src/libstore/download.hh | |
parent | e09161d05cfbd7c6d4cf41a35765e3fe346ea181 (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.hh | 6 |
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 |