add content type text/xml

This commit is contained in:
chungyau97
2023-07-16 09:49:11 +08:00
parent bb55198563
commit 97eb80b9b5
+1 -1
View File
@@ -320,7 +320,7 @@ export async function xmlScrape(currentURL: string, limit: number): Promise<stri
} }
const contentType: string | null = resp.headers.get('content-type') const contentType: string | null = resp.headers.get('content-type')
if ((contentType && !contentType.includes('application/xml')) || !contentType) { if ((contentType && !contentType.includes('application/xml') && !contentType.includes('text/xml')) || !contentType) {
if (process.env.DEBUG === 'true') console.error(`non xml response, content type: ${contentType}, on page: ${currentURL}`) if (process.env.DEBUG === 'true') console.error(`non xml response, content type: ${contentType}, on page: ${currentURL}`)
return urls return urls
} }