Skip to content

Commit b7d887c

Browse files
committed
i really screwed this up, huh
1 parent 9cf074d commit b7d887c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/kit/src/core/preview/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export async function preview({ port, host, config, https: use_https = false })
9696

9797
if (normalized !== pathname) {
9898
res.writeHead(307, {
99-
location: normalized + search
99+
location: base + normalized + search
100100
});
101101
res.end();
102102
return;
@@ -219,9 +219,10 @@ function scoped(scope, handler) {
219219

220220
return (req, res, next) => {
221221
if (req.url?.startsWith(scope)) {
222+
const original_url = req.url;
222223
req.url = req.url.slice(scope.length);
223224
handler(req, res, () => {
224-
req.url = scope + req.url;
225+
req.url = original_url;
225226
next();
226227
});
227228
} else {

0 commit comments

Comments
 (0)