diff --git a/src/utils/response.ts b/src/utils/response.ts index efde25be..a6c70116 100644 --- a/src/utils/response.ts +++ b/src/utils/response.ts @@ -24,15 +24,10 @@ export function defaultContentType (event: CompatibilityEvent, type?: string) { } export function sendRedirect (event: CompatibilityEvent, location: string, code = 302) { - const encodedLoc = encodeURI(decodeURI(location)) event.res.statusCode = code - event.res.setHeader('Location', encodedLoc) - // Minimal html document that redirects on client side - const html = ` - - - Redirecting to ${encodedLoc} -` + event.res.setHeader('Location', location) + const encodedLoc = location.replace(/"/g, '%22') + const html = `` return send(event, html, MIMES.html) }