diff options
author | Tony Tam <149837+tonytamsf@users.noreply.github.com> | 2022-01-04 07:11:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 16:11:24 +0100 |
commit | 814cd0f88ddee858c89f692a4fd6d03627012919 (patch) | |
tree | e31dd904ffb1236d9b6afa8a760e4f3a7ae7d2ed /core | |
parent | 92759d8d0519baa9d2bdc1acc08b02cc7a23afa8 (diff) | |
download | AntennaPod-814cd0f88ddee858c89f692a4fd6d03627012919.zip |
follow 301 for authorization headers during download (#5612)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/BasicAuthorizationInterceptor.java | 4 |
1 files changed, 4 insertions, 0 deletions
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 394eb3943..a2facae64 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 @@ -50,6 +50,10 @@ public class BasicAuthorizationInterceptor implements Interceptor { } Request.Builder newRequest = request.newBuilder(); + if (!TextUtils.equals(response.request().url().toString(), request.url().toString())) { + newRequest.url(response.request().url()); + } + Log.d(TAG, "Authorization failed, re-trying with ISO-8859-1 encoded credentials"); String credentials = HttpDownloader.encodeCredentials(parts[0], parts[1], "ISO-8859-1"); newRequest.header("Authorization", credentials); |