mirror of
https://github.com/intergalacticalvariable/reader.git
synced 2024-11-16 11:42:32 +08:00
feat: use urlToCrawl in cookie url
This commit is contained in:
parent
dcc3e5294d
commit
49a90ee7d4
|
@ -674,7 +674,7 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
|
|||
});
|
||||
}
|
||||
|
||||
const crawlOpts = this.configure(crawlerOptions, req);
|
||||
const crawlOpts = this.configure(crawlerOptions, req, urlToCrawl);
|
||||
console.log('Configured crawl options:', crawlOpts);
|
||||
|
||||
if (!ctx.req.accepts('text/plain') && ctx.req.accepts('text/event-stream')) {
|
||||
|
@ -865,7 +865,7 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
|
|||
}
|
||||
}
|
||||
|
||||
configure(opts: CrawlerOptions, req: Request) {
|
||||
configure(opts: CrawlerOptions, req: Request, urlToCrawl: URL) {
|
||||
|
||||
this.threadLocal.set('withGeneratedAlt', opts.withGeneratedAlt);
|
||||
this.threadLocal.set('withLinksSummary', opts.withLinksSummary);
|
||||
|
@ -881,7 +881,7 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
|
|||
(Array.isArray(req.headers['x-set-cookie']) ? req.headers['x-set-cookie'] : [req.headers['x-set-cookie']])
|
||||
.map(cookie => {
|
||||
const [name, value] = cookie.split('=');
|
||||
return { name, value, url: opts.url || req.query.url as string };
|
||||
return { name, value, url: urlToCrawl.toString() };
|
||||
})
|
||||
: [];
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user