File tree Expand file tree Collapse file tree
src/article-api/middleware Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ import contextualize from '#src/frame/middleware/context/context.js'
1313// for now, we're just querying pageinfo, we'll likely replace /api/pageinfo
1414// with /api/meta and move or reference that code here
1515async function getArticleMetadata ( req : ExtendedRequestWithPageInfo ) {
16+ const host = req . get ( 'x-host' ) || req . get ( 'x-forwarded-host' ) || req . get ( 'host' )
1617 const queryString = new URLSearchParams ( req . query as Record < string , string > ) . toString ( )
17- const apiUrl = `${ req . protocol } ://${ req . get ( ' host' ) } /api/pageinfo${ queryString ? `?${ queryString } ` : '' } `
18+ const apiUrl = `${ req . protocol } ://${ host } /api/pageinfo${ queryString ? `?${ queryString } ` : '' } `
1819
1920 // Fetch the data from the pageinfo API
2021 const response = await fetch ( apiUrl )
You can’t perform that action at this time.
0 commit comments