Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/kit/src/runtime/server/respond.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ export async function respond(request, options, manifest, state) {
let resolved_path;

try {
// reroute could alter the given URL, so we pass a copy
resolved_path = options.hooks.reroute({ url: new URL(url) }) ?? url.pathname;
// reroute could alter the given data, so we pass copies
resolved_path = options.hooks.reroute({
url: new URL(url),
headers: new Headers(request.headers),
}) ?? url.pathname;
} catch {
return text('Internal Server Error', {
status: 500
Expand Down
Loading