Skip to content

fix/242-url-normalizer#243

Draft
olios123 wants to merge 4 commits into
devfrom
fix/242-url-normalizer
Draft

fix/242-url-normalizer#243
olios123 wants to merge 4 commits into
devfrom
fix/242-url-normalizer

Conversation

@olios123
Copy link
Copy Markdown
Member

CLOSES #242

Copilot AI review requested due to automatic review settings April 24, 2026 19:29
@solvro
Copy link
Copy Markdown

solvro Bot commented Apr 24, 2026

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() and sanitizeRedirectPath() 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.

Comment thread src/lib/pathname.ts
Comment thread src/lib/pathname.ts
Comment thread src/proxy.ts
@olios123 olios123 marked this pull request as draft April 24, 2026 19:59
@Antoni-Czaplicki Antoni-Czaplicki force-pushed the fix/242-url-normalizer branch from c1ea16b to 01eccd7 Compare May 3, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Normalizacja linków

2 participants