File tree 1 file changed +7
-2
lines changed
vite-plugin-ssr/node/runtime
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ async function renderPageAndPrepare(
149
149
}
150
150
151
151
{
152
- const pageContextHttpReponse = getPermanentRedirect ( pageContextInit )
152
+ const pageContextHttpReponse = getPermanentRedirect ( pageContextInit , httpRequestId )
153
153
if ( pageContextHttpReponse ) return pageContextHttpReponse
154
154
}
155
155
@@ -467,7 +467,7 @@ function normalizePathname(pageContextInit: { urlOriginal: string }) {
467
467
return pageContextHttpResponse
468
468
}
469
469
470
- function getPermanentRedirect ( pageContextInit : { urlOriginal : string } ) {
470
+ function getPermanentRedirect ( pageContextInit : { urlOriginal : string } , httpRequestId : number ) {
471
471
const { redirects, baseServer } = getGlobalContext ( )
472
472
const urlWithoutBase = removeBaseServer ( pageContextInit . urlOriginal , baseServer )
473
473
let urlPathname : undefined | string
@@ -477,6 +477,11 @@ function getPermanentRedirect(pageContextInit: { urlOriginal: string }) {
477
477
} )
478
478
assert ( urlPathname )
479
479
if ( urlRedirect === urlWithoutBase ) return null
480
+ logRuntimeInfo ?.(
481
+ `Permanent redirect defined by your config.redirects (https://vite-plugin-ssr.com/redirects)` ,
482
+ httpRequestId ,
483
+ 'info'
484
+ )
480
485
urlRedirect = prependBase ( urlRedirect , baseServer )
481
486
assert ( urlRedirect !== pageContextInit . urlOriginal )
482
487
const httpResponse = createHttpResponseObjectRedirect ( { url : urlRedirect , statusCode : 301 } , urlPathname )
You can’t perform that action at this time.
0 commit comments