Skip to content

Commit a690646

Browse files
authored
Merge branch 'main' into fix-cloudflare
2 parents a29c2cb + 7c288f6 commit a690646

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/start": patch
3+
---
4+
5+
Sanitize Location header value in streaming redirect script

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)