@@ -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 ;
@@ -164,12 +158,9 @@ function SearchBarContent() {
164158 import ( 'meilisearch-docsearch' ) ,
165159 import ( 'meilisearch-docsearch/css' )
166160 ] ) . then ( ( [ { docsearch } ] ) => {
167- 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' ;
170161 const baseOptions = {
171162 container : searchButtonRef . current ,
172- host : useProxy ? ` ${ window . location . origin } /api` : meiliHost ,
163+ host : siteConfig . customFields . meilisearch . host ,
173164 apiKey : siteConfig . customFields . meilisearch . apiKey ,
174165 indexUid : siteConfig . customFields . meilisearch . indexUid ,
175166
@@ -265,8 +256,6 @@ function SearchBarContent() {
265256
266257 const search = docsearch ( baseOptions ) ;
267258
268- // If using proxy, docsearch will call `${origin}/api/indexes/<uid>/search`
269-
270259 searchInstanceRef . current = search ;
271260 setIsLoaded ( true ) ;
272261
0 commit comments