fix/242-url-normalizer#243
Draft
olios123 wants to merge 4 commits into
Draft
Conversation
|
The preview deployment for frontend-testownik-dev is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-05-03 14:21:30 CET |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes issue #242 by adding URL/path normalization so requests with duplicated slashes (e.g. ///) and unsafe redirect parameters don’t break navigation/auth flows.
Changes:
- Added
normalizePathname()andsanitizeRedirectPath()utilities for collapsing duplicated slashes and hardening redirects. - Added middleware-side pathname normalization/redirect in
src/proxy.ts. - Updated guest/login flows to use normalized/sanitized redirect paths, and added Vitest coverage for the new helpers.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/proxy.ts | Adds pathname normalization + redirect, and uses normalized URL when refreshing tokens. |
| src/lib/pathname.ts | Introduces shared helpers for pathname normalization and redirect sanitization. |
| src/lib/pathname.spec.ts | Adds unit tests covering normalization and redirect sanitization. |
| src/hooks/use-auto-guest.ts | Ensures guest auto-login redirect uses normalized pathnames. |
| src/components/login-prompt.tsx | Sanitizes redirect query param before building URLs / navigating. |
c1ea16b to
01eccd7
Compare
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.
CLOSES #242