feat: Add logging for scrapping options context

This commit is contained in:
Harsh Gupta 2024-08-15 14:59:49 +05:30 committed by Harsh Gupta (aider)
parent 77be0d08ff
commit c77135490b

View File

@ -195,7 +195,9 @@ export class CrawlerOptions extends AutoCastable {
res: Response,
} | undefined;
console.log(`ctx: ${JSON.stringify(ctx)}`);
const customMode = ctx?.req.get('x-respond-with') || ctx?.req.get('x-return-format');
console.log(`customMode: ${customMode}`);
if (customMode !== undefined) {
instance.respondWith = customMode;
}