Skip to content

Commit 767ab97

Browse files
committed
fix: produce relative redirect location url for same origin
1 parent 314da70 commit 767ab97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

edge-runtime/lib/response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export const buildResponse = async ({
210210
logger.withFields({ redirect_url: redirect }).debug('Redirect url is same as original url')
211211
return
212212
}
213-
edgeResponse.headers.set('location', redirect)
213+
edgeResponse.headers.set('location', relativizeURL(redirect, request.url))
214214
}
215215

216216
// Data requests shouldn't automatically redirect in the browser (they might be HTML pages): they're handled by the router

0 commit comments

Comments
 (0)