From fc91229b5dbd258795a670d2c740962f85b13da7 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 26 Apr 2022 18:35:46 +0200 Subject: [PATCH] Do not send null:null as credentials --- .../core/service/BasicAuthorizationInterceptor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/BasicAuthorizationInterceptor.java b/core/src/main/java/de/danoeh/antennapod/core/service/BasicAuthorizationInterceptor.java index fff2eb25b..e073872dc 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/BasicAuthorizationInterceptor.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/BasicAuthorizationInterceptor.java @@ -47,7 +47,9 @@ public class BasicAuthorizationInterceptor implements Interceptor { if (request.tag() instanceof DownloadRequest) { DownloadRequest downloadRequest = (DownloadRequest) request.tag(); userInfo = URIUtil.getURIFromRequestUrl(downloadRequest.getSource()).getUserInfo(); - if (TextUtils.isEmpty(userInfo)) { + if (TextUtils.isEmpty(userInfo) + && (!TextUtils.isEmpty(downloadRequest.getUsername()) + || !TextUtils.isEmpty(downloadRequest.getPassword()))) { userInfo = downloadRequest.getUsername() + ":" + downloadRequest.getPassword(); } } else {