Kaynağa Gözat

Update page exclusion function to not match double slashes

arvid-e 1 ay önce
ebeveyn
işleme
2074dade6e

+ 1 - 1
apps/app/src/features/search/utils/disable-user-pages.ts

@@ -1,7 +1,7 @@
 import type { QueryTerms } from '~/server/interfaces/search';
 import type { QueryTerms } from '~/server/interfaces/search';
 
 
 export function excludeUserPagesFromQuery(terms: QueryTerms): void {
 export function excludeUserPagesFromQuery(terms: QueryTerms): void {
-  const userRegex: RegExp = /^\/user($|\/)/;
+  const userRegex: RegExp = /^\/user($|\/(?!\/))/;
 
 
   terms.prefix = terms.prefix.filter((p) => !userRegex.test(p));
   terms.prefix = terms.prefix.filter((p) => !userRegex.test(p));
   terms.not_prefix = terms.not_prefix.filter((p) => !userRegex.test(p));
   terms.not_prefix = terms.not_prefix.filter((p) => !userRegex.test(p));