URL-Parser und -Encoder
Eine URL in Protokoll, Host, Pfad und Query-Parameter zerlegen oder Text prozentkodieren und dekodieren.
Läuft vollständig in Ihrem Browser – nichts, was Sie einfügen, wird hochgeladen.
Komponente für einen einzelnen Parameterwert, ganze URI, wenn eine vollständige Adresse maskiert wird und / ? # & = lesbar bleiben sollen.
https%3A%2F%2Fwww.ryuslog.com%2Fblog%3Fcategory%3DTypeScript%26tag%3Dtypes%2Bgenerics%26page%3D2%23results
- Protokoll
- https:
- Host
- www.ryuslog.com
- Pfad
- /blog
- Fragment
- #results
| Schlüssel | roh | dekodiert |
|---|---|---|
| category | TypeScript | TypeScript |
| tag | types+generics | types generics |
| page | 2 | 2 |
Reservierte URL-Zeichen
Kurzreferenz- %20
- Kodiertes Leerzeichen. In einem Query-String lesen die meisten Formularparser auch + als Leerzeichen.
- %2F %3F %23
- Kodierter Schrägstrich, Fragezeichen und Raute – die drei Zeichen, die sonst die URL-Struktur verändern.
- %26 %3D
- Kodiertes Ampersand und Gleichheitszeichen, innerhalb eines Parameterwerts nötig, damit die Query nicht geteilt wird.
- encodeURIComponent
- Maskiert einen einzelnen Parameterwert einschließlich / ? # & = – die richtige Wahl für Query-Werte.
- encodeURI
- Lässt Strukturzeichen intakt und ist daher für eine ganze URL gedacht, nicht für einen einzelnen Wert.
- new URL(input)
- Eingebauter Parser, der protocol, host, pathname, searchParams und hash liefert.
Passende Next.js-Syntax-Guides
Alle Next.js-GuidesNext.js Server Actions: Swallowed Redirects and Body Limits
redirect() throws, so a try/catch swallows the navigation; the action body parser has a 1 MB limit; and useActionState cannot hold an Error. Fixes for all three.
Next.jsSupabase SSR on Next.js: Stale Sessions and Lock Timeouts
The session flips between signed-in and signed-out because the refreshed token is written to a cookie store that no longer exists. Adapter, proxy and lock fixes.
Next.jsNext.js Standalone in Docker: Missing CSS and sharp Module Errors
output standalone copies server.js only, so /_next/static and public are missing and every page renders unstyled. The image and copy fixes, plus the sharp native binding error.
Next.jsNext.js 16 Upgrade: Async Params, proxy.ts, and Turbopack Build Breaks
The codemod gets you most of the way; the rest is async request APIs, a webpack config Turbopack refuses, and a renamed middleware file that silently stops running.