fix: allow upgrading HTTP to HTTPS for redirects #3978
Merged
+8
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief Summary
Allow adding podcasts where the server detects an
http
domain and redirects to anhttps
domain. Currently, these fail with an error message that is not useful to the end user.Which Issue is Fixed?
Fixes #3142
Fixes #3658
In-Depth Description
This error occurs for several mainstream podcasts, likely impacting multiple users. I lost some spouse approval points due to this issue. 😅
The root cause is that we are not allowing the Axios client to redirect between domains with different protocols. As a result, any feed URL detected as
http
that redirects to a differenthttps
domain would fail, leaving users without a clear resolution.The Fix
http
tohttps
.https
and retry the request.https
version or another protocol change occurs (e.g.,https
→http
), the request will still fail, ensuring we do not introduce security risks.How Have You Tested This?
I confirmed that the following podcasts were failing to add in the current version (
v2.19.2
) of Audiobookshelf.After making my changes, I was able to successfully add all three podcasts through the UI: