diff --git a/src/endpoints/search.js b/src/endpoints/search.js index 6e21dfa5c..87152b3d6 100644 --- a/src/endpoints/search.js +++ b/src/endpoints/search.js @@ -160,7 +160,7 @@ router.post('/transcript', jsonParser, async (request, response) => { router.post('/searxng', jsonParser, async (request, response) => { try { - const { baseUrl, query } = request.body; + const { baseUrl, query, preferences } = request.body; if (!baseUrl || !query) { console.log('Missing required parameters for /searxng'); @@ -188,6 +188,9 @@ 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) { + searchParams.append('preferences', preferences); + } searchUrl.search = searchParams.toString(); const searchResult = await fetch(searchUrl, { headers: visitHeaders });