Skip to content

Commit

Permalink
fix: Fixup Downloader not spotting bearer configuration for suppressi…
Browse files Browse the repository at this point in the history
…onFiles
  • Loading branch information
aikebah committed Dec 31, 2024
1 parent 68129b0 commit 9c5dac9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ private static void wrapAndThrowHttpResponseException(String url, HttpResponseEx
*/
public void fetchFile(URL url, File outputPath, boolean useProxy, String userKey, String passwordKey, String tokenKey)
throws DownloadFailedException, TooManyRequestsException, ResourceNotFoundException, URLConnectionFailureException {
if ("file".equals(url.getProtocol())
|| userKey == null || settings.getString(userKey) == null
|| passwordKey == null || settings.getString(passwordKey) == null
) {
final boolean basicConfigured = userKey != null && settings.getString(userKey) != null
&& passwordKey != null && settings.getString(passwordKey) != null;
final boolean tokenConfigured = tokenKey != null && settings.getString(tokenKey) != null;
if ("file".equals(url.getProtocol()) || (!basicConfigured && !tokenConfigured)) {
// no credentials configured, so use the default fetchFile
fetchFile(url, outputPath, useProxy);
return;
Expand Down

0 comments on commit 9c5dac9

Please sign in to comment.