TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Debug browser redirects without ruining your day

47 pointsby cassidooabout 2 years ago

7 comments

compumikealmost 2 years ago
Lots of sites especially have broken www -&gt; root domain redirects, and http -&gt; https redirects. Often these redirects aren’t covered by your CI tests either.<p>The article is good for one-off debugging (curl is my personal favorite). For continuous monitoring, we at Heii On-Call just last week released website monitoring to assert an HTTP response status code plus Location header [1], and have some best practices for redirect monitoring for anyone with a website which will be published next week.<p>FYI these features were requested by a user who signed up from HN a few weeks ago and wanted to monitor these redirects in addition to their homepage. Hope that helps.<p>[1] <a href="https:&#x2F;&#x2F;heiioncall.com&#x2F;blog&#x2F;your-probes-your-rules-expected-http-status-codes-and-location-headers" rel="nofollow">https:&#x2F;&#x2F;heiioncall.com&#x2F;blog&#x2F;your-probes-your-rules-expected-...</a>
asbalmost 2 years ago
I can recommend writing a short script to test redirects and cache control are configured as expected for your site - here&#x27;s mine (health warning: shell script) <a href="https:&#x2F;&#x2F;github.com&#x2F;muxup&#x2F;muxup-site&#x2F;blob&#x2F;main&#x2F;utils&#x2F;server_test.sh">https:&#x2F;&#x2F;github.com&#x2F;muxup&#x2F;muxup-site&#x2F;blob&#x2F;main&#x2F;utils&#x2F;server_t...</a>
stranded22about 2 years ago
Chrome has a much nicer redirect url checker - the link tools included in this article doesn&#x27;t always work.<p>If you can use chrome, then use this one, best I have found in my travels - <a href="https:&#x2F;&#x2F;chrome.google.com&#x2F;webstore&#x2F;detail&#x2F;redirect-path&#x2F;" rel="nofollow">https:&#x2F;&#x2F;chrome.google.com&#x2F;webstore&#x2F;detail&#x2F;redirect-path&#x2F;</a><p>Other than that, I found this article really interesting - has gotten me into now exploring curl (especially after setting my pi 4 up as a mullvad vpn gateway with nextdns for my home network)
评论 #36016587 未加载
WirelessGigabitalmost 2 years ago
Client side redirects aren&#x27;t the only reason why Dev Tools sometimes drop stuff.<p>I quite often try to debug a 201 and the body is not retained in the Dev Tools, even with &#x27;Preserve logs&#x27; turned on.
iudqnolqabout 2 years ago
I wish Firefox was as good as Chrome at correlating page visits and network requests.<p>It particularly annoys me if you reload a page with a websocket open you see the logs for the websocket closing right at the start of the subsequent load. (Preserve logs is off of course)<p>There are multiple decades old bugzilla discussions about Firefox&#x27;s idiosyncratic websocket lifecycle handling. Not sure exactly which causes this, doesn&#x27;t seem to be much point in debugging further
cmcconomyabout 2 years ago
the worst is meta tag refresh - not many browser tools for disabling it
评论 #36015525 未加载
评论 #35997978 未加载
montroseralmost 2 years ago
On the server side, punch into your web framework&#x27;s redirect function a log with a stack trace in lower environments. That way, any time you send a redirect, you know which code was responsible, and there&#x27;s no guess work involved.<p>This is especially useful in the funnest kind of cases where you have mutual recursion or other types of loops.