fix: mixed content blocking for S.to cover images on HTTPS#193
Open
HaiNick wants to merge 1 commit into
Open
Conversation
Reverse-proxy upstream poster URLs through /api/proxy-image so the browser loads them from the same origin. This unblocks HTTPS deployments (e.g. behind Tailscale Funnel) where mixed content silently broke cover images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
S.to cover images are served from
http://186.2.175.5(plain HTTP). When the web UI is accessed over HTTPS (e.g. via a reverse proxy, Tailscale Serve, or any TLS-terminated setup), the browser blocks these image requests as mixed content. The images just fail silently with no error in the UI.This affects all browse endpoints (
/api/new-series,/api/popular-series, etc.) and the series detail view.Root cause
The S.to CDN returns absolute HTTP image URLs. The backend passes these directly to the frontend, which then tries to load them as
<img src="http://...">from an HTTPS page, which the browser blocks as a security violation.Fix
Added a server-side image proxy endpoint (
/api/proxy-image) that fetches external cover images on behalf of the browser. Allposter_urlvalues are rewritten to route through this endpoint before being sent to the frontend.Cache-Controlhttp://andhttps://URLs, returns400for anything elseScreenshots
Before (Tailscale HTTPS, broken):

Before (Tailscale HTTPS, broken - DevTools):

After (Tailscale HTTPS, fixed):

After (Tailscale HTTPS, fixed - DevTools):

Testing
Tested locally over plain HTTP (
http://192.168.178.168:8070) and over HTTPS via Tailscale Serve (https://aniworld-test.snowy-burbot.ts.net). Cover images load correctly in both cases. Confirmed200 OKwith browser cache hits on repeat views.