aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/common-eval-args.cc
diff options
context:
space:
mode:
authorGreg Hale <imalsogreg@gmail.com>2020-06-17 15:08:59 -0400
committerGreg Hale <imalsogreg@gmail.com>2020-09-16 13:46:48 -0400
commita303c0b6dc71b1e0d6a57986c3f7a9b61361cd92 (patch)
tree1fe085d5c3d809b69600a4c883fb5ddcbfb09418 /src/libexpr/common-eval-args.cc
parent5080d4e7b2525d1656282c65a217a22ff8381df3 (diff)
Fetch commits from github/gitlab using Auth header
`nix flake info` calls the github 'commits' API, which requires authorization when the repository is private. Currently this request fails with a 404. This commit adds an authorization header when calling the 'commits' API. It also changes the way that the 'tarball' API authenticates, moving the user's token from a query parameter into the Authorization header. The query parameter method is recently deprecated and will be disallowed in November 2020. Using them today triggers a warning email.
Diffstat (limited to 'src/libexpr/common-eval-args.cc')
-rw-r--r--src/libexpr/common-eval-args.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/common-eval-args.cc b/src/libexpr/common-eval-args.cc
index 10c1a6975..d71aa22f1 100644
--- a/src/libexpr/common-eval-args.cc
+++ b/src/libexpr/common-eval-args.cc
@@ -76,7 +76,7 @@ Path lookupFileArg(EvalState & state, string s)
if (isUri(s)) {
return state.store->toRealPath(
fetchers::downloadTarball(
- state.store, resolveUri(s), "source", false).first.storePath);
+ state.store, resolveUri(s), Headers {}, "source", false).first.storePath);
} else if (s.size() > 2 && s.at(0) == '<' && s.at(s.size() - 1) == '>') {
Path p = s.substr(1, s.size() - 2);
return state.findFile(p);