mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
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
This commit is contained in:
parent
e09161d05c
commit
1d5d277ac7
3 changed files with 38 additions and 4 deletions
|
@ -67,7 +67,13 @@ protected:
|
|||
const std::string & data,
|
||||
const std::string & mimeType) override
|
||||
{
|
||||
throw UploadToHTTP("uploading to an HTTP binary cache is not supported");
|
||||
auto data_ = std::make_shared<string>(data);
|
||||
auto req = DownloadRequest(cacheUri + "/" + path, data_, mimeType);
|
||||
try {
|
||||
getDownloader()->download(req);
|
||||
} catch (DownloadError & e) {
|
||||
throw UploadToHTTP(format("uploading to HTTP binary cache at %1% not supported: %2%") % cacheUri % e.msg());
|
||||
}
|
||||
}
|
||||
|
||||
void getFile(const std::string & path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue