Build

URL Parser — Break a URL Into Its Parts

This decomposes a URL into its components — scheme, credentials, host, port, path, query parameters and fragment — and shows each separately, decoded. Long URLs with a dozen tracking parameters are difficult to read reliably by eye, and the mistakes that hide in them are exactly the ones that produce puzzling behaviour.

When it helps

Because parameters are where it goes wrong. A duplicated key, where the server takes the first and you assumed the last. A value containing an unencoded ampersand that split into two parameters. A fragment that never reaches the server at all, which surprises people who put state in it. Seeing the parsed structure rather than the string makes each of those immediately obvious, and reading them out of a long query string does not.

Worth running automatically

The pattern worth automating is redirect chains. Each hop is a full round trip, and chains grow quietly as rules accumulate — an http to https redirect, then a www canonicalisation, then a trailing-slash rule, and a request now takes three round trips before it lands. Nothing breaks, so nothing reports it. Following redirects on a schedule and asserting on the number of hops catches the growth, and also catches a parameter being dropped somewhere in the chain.

What you get out of it

Makes a long URL legible and shows exactly which component is wrong. The redirect-chain check it enables is worth more, because chains grow without any symptom until someone measures them.

Also in Build