MangaBox: send Referer on image requests - #19360
Open
maxpower212 wants to merge 1 commit into
Open
maxpower212 wants to merge 1 commit into
maxpower212 wants to merge 1 commit into
Conversation
Mangabox image CDNs now reject hotlinked requests: they answer with a Cloudflare 403 unless the Referer is the site origin with a trailing slash. imageRequest() was built from the default headers, which carry no Referer, so every page failed and the CDN fallback interceptor ended in "All CDN attempts failed". The merge-images size probe issued the same headerless request, so merging silently disabled itself as well. baseVersionCode is bumped since this changes multisrc theme code.
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.
Summary
Mangabox image CDNs now reject hotlinked requests, so every chapter page fails to load for the sources built on this theme (Mangabat, Mangakakalot, Manganelo).
imageRequest()is built from the default headers, which carry noRefererat all, so each request gets a Cloudflare 403 and the CDN fallback interceptor ends inIOException("All CDN attempts failed"), which is what users see as the CDN error.This sends the
Refererthe CDNs now require, and reuses the same headers for the merge-images size probe, which issued the same headerless request and therefore silently disabled merging.Evidence
Measured against Mangabat's CDN from a residential connection, using the request shape the extension produces (no cookies, no special session):
imgs-2.2xstorage.com/apotheosis/1/0.webpRefererReferer: https://example.com/Referer: https://www.mangabats.com/manga/apotheosis/chapter-1(the chapter URL)Referer: https://mangabats.com/(nowww)Referer: https://www.mangabats.com(no trailing slash)Referer: https://www.mangabats.com/image/webp, 84 KBokhttp/4.12.0and a Mihon-style agent, and 200 with every one of them once the Referer is correct.img-r1/img-r2.2xstorage.com) return 404 for these same paths even with the correct Referer, so the existing failover cannot rescue it.Changes
imageRequest()now sendsReferer: $baseUrl/.baseUrlfollows the configured mirror, so the Mangakakalot and Manganelo mirrors send their own origin.baseVersionCode15 -> 16, since this is multisrc theme code.Not verified
Mangabat (
www.mangabats.com) is the only one I could verify.mangakakalot.ggandnatomanga.comchapter pages are currently behind a Cloudflare challenge from this network, so I could not confirm the requirement there. The added header is additive for them, and the origin sent is whatever mirror the user has configured.Checklist
versionCodevalue inbuild.gradle.kts— not applicable, the change is in multisrc theme code rather than a single extensionbaseVersionCodeinbuild.gradle.kts— 15 -> 16contentWarningconfiguration inbuild.gradle.ktsappropriately — untouchedidif a source's name or language were changed — not applicableweb_hi_res_512.pngwhen adding a new extension — not applicable🤖 This PR was opened by an AI agent (Hermes Agent, running on the account holder's own machine) at the request of a user whose reading was broken by this. The diff, the measurements above and the version bump were produced and verified by that agent; the account holder authorised submitting it and has been given the evidence. The AI-assisted box above is theirs to tick.