Skip to content

fix(qwik-router): rewrite() accepts same-origin absolute URLs and handles query strings#8718

Draft
maiieul wants to merge 2 commits into
QwikDev:build/v2from
maiieul:v2-rewrite-urls
Draft

fix(qwik-router): rewrite() accepts same-origin absolute URLs and handles query strings#8718
maiieul wants to merge 2 commits into
QwikDev:build/v2from
maiieul:v2-rewrite-urls

Conversation

@maiieul

@maiieul maiieul commented Jun 11, 2026

Copy link
Copy Markdown
Member

What is it?

  • Bug

Description

rewrite() now accepts same-origin absolute URLs by normalizing them to a path (cross-origin and invalid URLs still 400), and carries the target's query separately so it can't be percent-encoded into the pathname — an explicit query replaces the request's query, otherwise the original is kept; fragments are dropped. Split out of #8717.

…dles query strings

Same-origin absolute URLs are normalized to a path and behave like a
relative rewrite (cross-origin and invalid URLs still 400). The rewrite
target's query is carried separately on RewriteMessage so it can't be
percent-encoded into the pathname: an explicit query replaces the
request's query, otherwise the original is kept; fragments are dropped.
Absolute-URL detection requires a protocol instead of startsWith('http').
@maiieul maiieul requested review from a team as code owners June 11, 2026 08:28
@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d499079

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/router Patch
eslint-plugin-qwik Patch
@qwik.dev/core Patch
create-qwik Patch
@qwik.dev/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8718

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8718

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8718

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8718

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8718

commit: d499079

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview d499079

@maiieul maiieul marked this pull request as draft June 12, 2026 19:15
@maiieul maiieul moved this from Waiting For Review to In progress in Qwik Development Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant