File tree Expand file tree Collapse file tree 2 files changed +2
-57
lines changed
Expand file tree Collapse file tree 2 files changed +2
-57
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -39,12 +39,6 @@ function SearchBarContent() {
3939 const uuid = ( typeof crypto !== 'undefined' && crypto . randomUUID ) ? crypto . randomUUID ( ) : Math . random ( ) . toString ( 36 ) . slice ( 2 ) + Date . now ( ) . toString ( 36 ) ;
4040 const value = JSON . stringify ( { id : uuid , month : monthKey } ) ;
4141 window . localStorage . setItem ( key , value ) ;
42- try {
43- // Also set a same‑origin cookie so serverless proxy can read it
44- const ttlDays = 45 ; // longer than a month for safety; we rotate monthly client‑side
45- const maxAge = ttlDays * 24 * 60 * 60 ;
46- document . cookie = `msUserId=${ uuid } ; Max-Age=${ maxAge } ; Path=/; SameSite=Lax` + ( window . location . protocol === 'https:' ? '; Secure' : '' ) ;
47- } catch { }
4842 return uuid ;
4943 } catch ( _ ) {
5044 return null ;
@@ -165,8 +159,8 @@ function SearchBarContent() {
165159 import ( 'meilisearch-docsearch/css' )
166160 ] ) . then ( ( [ { docsearch } ] ) => {
167161 const meiliHost = siteConfig . customFields . meilisearch . host ;
168- // Use proxy on non-localhost to avoid CORS limits and inject server-side header
169- const useProxy = typeof window !== 'undefined' && window . location && window . location . hostname !== 'localhost' ;
162+ // Always call Meili directly (no proxy) since env config isn’t accessible
163+ const useProxy = false ;
170164 const baseOptions = {
171165 container : searchButtonRef . current ,
172166 host : useProxy ? `${ window . location . origin } /api` : meiliHost ,
You can’t perform that action at this time.
0 commit comments