From 61ddb720d76c2c80259534483b44503f8cdc9c0a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:09:21 +0200 Subject: [PATCH] Improve backward compatibility if `preferences` are not passed --- src/endpoints/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/endpoints/search.js b/src/endpoints/search.js index 87152b3d6..e29e53008 100644 --- a/src/endpoints/search.js +++ b/src/endpoints/search.js @@ -188,7 +188,7 @@ router.post('/searxng', jsonParser, async (request, response) => { const searchUrl = new URL('/search', baseUrl); const searchParams = new URLSearchParams(); searchParams.append('q', query); - if (preferences.length > 0) { + if (preferences) { searchParams.append('preferences', preferences); } searchUrl.search = searchParams.toString();