We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a29c2cb + 7c288f6 commit a690646Copy full SHA for a690646
2 files changed
.changeset/sanitize-location-header.md
@@ -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
@@ -213,7 +213,7 @@ function handleStreamCompleteRedirect(context: PageEvent) {
213
return ({ write }: { write: (html: string) => void }) => {
214
context.complete = true;
215
const to = context.response && context.response.headers.get("Location");
216
- to && write(`<script>window.location="${to}"</script>`);
+ to && write(`<script>window.location=${JSON.stringify(to).replace(/</g, "\\u003c")}</script>`);
217
};
218
}
219
0 commit comments