Skip to content

Commit e48ad30

Browse files
authored
Revert "Fix: Use Netlify functions for production search to keep API key secu…" (#2425)
This reverts commit 5492acc.
1 parent 855730c commit e48ad30

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/theme/Navbar/Search/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,12 +1150,11 @@ const getMeilisearchConfig = (): SearchConfig => {
11501150
const isDevelopment = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
11511151

11521152
if (isProduction || isNetlifyPreview || isTestingBranch || isDevelopment) {
1153-
// Always use Netlify functions for production and previews to keep API key secure
1154-
const useNetlifyFunctions = isProduction || isNetlifyPreview || window.location.hostname.includes('netlify.app');
1153+
const isNetlify = window.location.hostname.includes('netlify.app') || isNetlifyPreview;
11551154

11561155
return {
11571156
enabled: true,
1158-
hostUrl: useNetlifyFunctions ?
1157+
hostUrl: isNetlify ?
11591158
`${window.location.origin}/.netlify/functions/meilisearch` :
11601159
"https://ms-3ade175771ef-34593.sfo.meilisearch.io",
11611160
apiKey: "",

0 commit comments

Comments
 (0)