Skip to content

Commit d4fd44f

Browse files
committed
escape Location header with JSON.stringify
1 parent abe3979 commit d4fd44f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/start/src/server/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function handleStreamCompleteRedirect(context: PageEvent) {
213213
return ({ write }: { write: (html: string) => void }) => {
214214
context.complete = true;
215215
const to = context.response && context.response.headers.get("Location");
216-
to && write(`<script>window.location="${to}"</script>`);
216+
to && write(`<script>window.location=${JSON.stringify(to).replace(/</g, "\\u003c")}</script>`);
217217
};
218218
}
219219

0 commit comments

Comments
 (0)