fix: use 'no-content' (#1154)

* fix: use 'no-content' in x-respond-with

* fix: use 'no-content' in x-respond-with
This commit is contained in:
Aaron Ji 2025-03-03 17:00:18 +08:00 committed by GitHub
parent 51109e01d2
commit 3d29b3069a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,7 +91,7 @@ export class SearcherHost extends RPCHost {
const uid = await auth.solveUID();
// Return content by default
const respondWith = ctx.req.get('X-Respond-With') ?? 'content';
const crawlWithoutContent = !respondWith.includes('content');
const crawlWithoutContent = respondWith.includes('no-content');
let chargeAmount = 0;
const noSlashPath = decodeURIComponent(ctx.req.path).slice(1);
@ -352,7 +352,7 @@ export class SearcherHost extends RPCHost {
if (withContent) {
result.content = ['html', 'text', 'screenshot'].includes(mode) ? undefined : '';
}
if (mode.includes('favicon')) {
if (mode.includes('no-content')) {
const url = new URL(upstreamSearchResult.link);
result.favicon = await this.getFavicon(url.origin);
dataItems.push({