(baseUrl: string)
| 177 | } |
| 178 | |
| 179 | async function checkSitemap(baseUrl: string): Promise<boolean> { |
| 180 | try { |
| 181 | const sitemapUrl = new URL('/sitemap.xml', baseUrl).toString(); |
| 182 | const controller = new AbortController(); |
| 183 | const timeout = setTimeout(() => controller.abort(), 3000); |
| 184 | |
| 185 | const response = await fetch(sitemapUrl, { |
| 186 | signal: controller.signal, |
| 187 | headers: { |
| 188 | 'User-Agent': 'OpenPanel-SiteChecker/1.0', |
| 189 | }, |
| 190 | }); |
| 191 | |
| 192 | clearTimeout(timeout); |
| 193 | return response.ok; |
| 194 | } catch { |
| 195 | return false; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | async function getSSLInfo( |
| 200 | hostname: string, |
no test coverage detected