Skip to content

Commit

Permalink
[remote/downloader] Migrate Downloader to take Credentials
Browse files Browse the repository at this point in the history
Progress on bazelbuild#15856

Closes bazelbuild#16601.

PiperOrigin-RevId: 485837451
Change-Id: I785882d0ff3e171dcaee6aa6f628bca9232c730a
  • Loading branch information
Yannic authored and Lucas Ripoche committed Jun 13, 2023
1 parent 63e1fed commit 3a1035d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public Path download(
try {
downloader.download(
rewrittenUrls,
credentialFactory.create(rewrittenAuthHeaders),
new StaticCredentials(rewrittenAuthHeaders),
checksum,
canonicalId,
destination,
Expand Down Expand Up @@ -348,7 +348,7 @@ public byte[] downloadAndReadOneUrl(
for (int attempt = 0; attempt <= retries; ++attempt) {
try {
return httpDownloader.downloadAndReadOneUrl(
rewrittenUrls.get(0), credentialFactory.create(authHeaders), eventHandler, clientEnv);
rewrittenUrls.get(0), new StaticCredentials(authHeaders), eventHandler, clientEnv);
} catch (ContentLengthMismatchException e) {
if (attempt == retries) {
throw e;
Expand Down

0 comments on commit 3a1035d

Please sign in to comment.