audiobookshelf/server/utils
Conner McCall f460297daf
fix: allow upgrading HTTP to HTTPS for redirects
Re: #3142 and #3658

When adding certain podcasts, the server encountered a redirect from an HTTP URL to an HTTPS domain, causing an error that was difficult for end users to diagnose without inspecting logs or HTML.

This issue arose due to SSRF security measures that blocked such redirects. Instead of failing in these cases, we now detect when the error is caused by an HTTP-to-HTTPS upgrade. If confirmed, we upgrade the initial URL to HTTPS and resend the request.

Since this change does not allow cross-protocol or cross-domain redirections, it remains secure while resolving most of the reported issues.

Affected podcasts that are now fixed:

- D&D is for Nerds
- The New Yorker: The Writer's Voice - New Fiction from The New Yorker
- Radiolab
2025-02-13 09:19:02 -06:00
..
generators
migrations Migrate tools and collapse series. fix continue shelves. remove old objects 2025-01-05 14:09:03 -06:00
parsers Fix name parser to not use "last, first" format when not using comma separators. Adds unit tests #3940 2025-02-05 17:25:31 -06:00
queries Fix server crash remove column name ambiguity #3966 2025-02-12 08:52:20 -06:00
areEquivalent.js
comicBookExtractors.js Fix catch exception on failed to parse comic metadata #3804 2025-01-08 16:53:56 -06:00
constants.js
ffmpegHelpers.js Update podcast downloads to fallback to download without tagging due to inaccurate rss feed enclosures #3837 2025-01-14 15:48:06 -06:00
fileUtils.js Update downloadFile to debug log percentage complete 2025-02-05 16:15:00 -06:00
globals.js
htmlEntities.js
htmlSanitizer.js Update custom metadata provider results to sanitize html descriptions #3880 2025-01-26 10:51:18 -06:00
index.js Update RSS feed to exclude empty tags, format duration, use CDATA 2025-01-20 13:57:56 -06:00
libraryHelpers.js Migrate tools and collapse series. fix continue shelves. remove old objects 2025-01-05 14:09:03 -06:00
longTimeout.js
notifications.js
podcastUtils.js fix: allow upgrading HTTP to HTTPS for redirects 2025-02-13 09:19:02 -06:00
prober.js Fix merging embedded chapters for multi-track audiobooks giving incorrect chapter ids #3361 2025-01-12 09:56:48 -06:00
profiler.js Add a profile utility function 2025-02-08 10:41:56 +02:00
scandir.js
zipHelpers.js