From 2a2aa6a61f22a5cd17ea004b617626dd21b52607 Mon Sep 17 00:00:00 2001 From: Harry-zklcdc Date: Thu, 18 Jan 2024 13:39:51 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=20=F0=9F=90=9B=20Draw=20&=20Recognize=20I?= =?UTF-8?q?mage=20in=20Cloudflare=20Deploy=20#294?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudflare/worker.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cloudflare/worker.js b/cloudflare/worker.js index 8c5816e68d..4147241994 100644 --- a/cloudflare/worker.js +++ b/cloudflare/worker.js @@ -272,10 +272,8 @@ export default { }); newHeaders.set('host', targetUrl.host); newHeaders.set('origin', BING_ORIGIN); - if (request.headers.has('referer')) { - if (request.headers.get('referer').indexOf('web/compose.html') != -1) { - newHeaders.set('referer', 'https://edgeservices.bing.com/edgesvc/compose'); - } + if (request.headers.has('referer') && request.headers.get('referer').indexOf('web/compose.html') != -1) { + newHeaders.set('referer', 'https://edgeservices.bing.com/edgesvc/compose'); } else { newHeaders.set('referer', 'https://www.bing.com/search?q=Bing+AI&showconv=1&FORM=hpcodx'); }