[PR #3978] [MERGED] fix: allow upgrading HTTP to HTTPS for redirects #4136

Closed
opened 2026-04-25 00:18:27 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3978
Author: @sloped
Created: 2/13/2025
Status: Merged
Merged: 2/19/2025
Merged by: @advplyr

Base: masterHead: fix/detect-http-https-upgrades


📝 Commits (1)

  • f460297 fix: allow upgrading HTTP to HTTPS for redirects

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 server/utils/podcastUtils.js (+8 -0)

📄 Description

Brief Summary

Allow adding podcasts where the server detects an http domain and redirects to an https 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 different https domain would fail, leaving users without a clear resolution.

The Fix

  • When a podcast feed request fails due to a redirection error caused by an invalid protocol, we check if the redirection is from http to https.
  • If so, we upgrade the original URL to https and retry the request.
  • If the original URL does not have a corresponding https version or another protocol change occurs (e.g., httpshttp), 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:

  • D&D is for Nerds
  • The New Yorker: The Writer's Voice - New Fiction from The New Yorker
  • Radiolab

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3978 **Author:** [@sloped](https://github.com/sloped) **Created:** 2/13/2025 **Status:** ✅ Merged **Merged:** 2/19/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix/detect-http-https-upgrades` --- ### 📝 Commits (1) - [`f460297`](https://github.com/advplyr/audiobookshelf/commit/f460297dafa6ddf1ced9bdacaef8609626a9f392) fix: allow upgrading HTTP to HTTPS for redirects ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/podcastUtils.js` (+8 -0) </details> ### 📄 Description ## Brief Summary Allow adding podcasts where the server detects an `http` domain and redirects to an `https` 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 different `https` domain would fail, leaving users without a clear resolution. ### **The Fix** - When a podcast feed request fails due to a redirection error caused by an invalid protocol, we check if the redirection is **from `http` to `https`**. - If so, we upgrade the **original** URL to `https` and retry the request. - If the original URL does not have a corresponding `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: - *D&D is for Nerds* - *The New Yorker: The Writer's Voice - New Fiction from The New Yorker* - *Radiolab* --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:27 +02:00
adam closed this issue 2026-04-25 00:18:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4136