Repository navigation
fix: resolve favicon links after redirect - #14211
Conversation
Security rulesNo new WARNING or ERROR findings from security rules. 32 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
@hansi-codes review |
🟢 Tier S · Ready to mergeThe favicon action now captures the last URL requested while fetching the page and uses it to resolve relative icon links. Its
📂 Walkthrough · 1
Reviewed |
safeFetch followed redirects but discarded the URL it landed on, so relative icon links and the /favicon.ico fallback were resolved against the original request.
b1426b9 to
fc7ad2a
Compare
|
@hansi-codes review |
The fix only needs safeFetch to report the URL it landed on; selecting the icon stays in Get.php instead of a separate Avatars library.
|
Review complete. No issues found — approved ✅. This PR modifies the favicon fetch action (
Reviewed commit: 2214fbb |
What does this PR do?
Fixes favicon resolution after a website redirects.
safeFetch()followed redirects but dropped the URL it landed on, so relative<link rel="icon">hrefs and the/favicon.icofallback were resolved against the original request.safeFetch()now reports the last URL it requested, and the action resolves icon links and the/favicon.icofallback against it. The fallback goes throughURL::resolveLocation()instead of rebuildingscheme://host, so it also keeps a non-default port.Fixes #13985
Test Plan
Ran the action against a real redirect,
https://httpbin.org/redirect-to?url=https://appwrite.io/:https://httpbin.org/logo.svgavatar_icon_not_foundhttps://appwrite.io/logo.svgimage/svg+xmlhttps://github.com/(no redirect) still returns its absolute SVG icon.tests/unit/Network/FetcherTest.phppasses unchanged, and Pint and PHPStan are clean on the changed file.Related PRs and Issues
Checklist