File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/overmind-website/backend Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -104,18 +104,21 @@ const apis = getApis()
104104const searchData = getSearchData ( )
105105
106106const googleCrawlMiddleware = async function ssr ( req , res , next ) {
107+ const url = req . protocol + '://' + req . hostname + req . path
108+
107109 if (
108110 req
109111 . get ( 'user-agent' )
110112 . toLowerCase ( )
111- . indexOf ( 'googlebot' ) >= 0
113+ . indexOf ( 'googlebot' ) >= 0 &&
114+ ! path . extname ( url )
112115 ) {
113116 const browser = await puppeteer . launch ( {
114117 headless : true ,
115118 args : [ '--no-sandbox' ] ,
116119 } )
117120 const page = await browser . newPage ( )
118- await page . goto ( req . hostname + req . path , { waitUntil : 'networkidle0' } )
121+ await page . goto ( url , { waitUntil : 'networkidle0' } )
119122 const html = await page . content ( )
120123 await browser . close ( )
121124
You can’t perform that action at this time.
0 commit comments