|
|
@@ -52,9 +52,9 @@ const convertPathPatternsToRegExp = (pagePathPatterns: string[]): Array<string |
|
|
|
if (isGrobPatternPath(pagePathPattern)) {
|
|
|
const trimedPagePathPattern = pagePathPattern.replace('/*', '');
|
|
|
const escapedPagePathPattern = escapeStringRegexp(trimedPagePathPattern);
|
|
|
- return new RegExp(`^${escapedPagePathPattern}`);
|
|
|
+ // https://regex101.com/r/x5KIZL/1
|
|
|
+ return new RegExp(`^${escapedPagePathPattern}($|/)`);
|
|
|
}
|
|
|
-
|
|
|
return pagePathPattern;
|
|
|
});
|
|
|
};
|
|
|
@@ -524,6 +524,7 @@ class OpenaiService implements IOpenaiService {
|
|
|
): Promise<mongoose.FilterQuery<PageDocument>> {
|
|
|
|
|
|
const converterdPagePathPatterns = convertPathPatternsToRegExp(pagePathPatterns);
|
|
|
+ console.log('converterdPagePathPatterns', converterdPagePathPatterns);
|
|
|
|
|
|
// Include pages in search targets when their paths with 'Anyone with the link' permission are directly specified instead of using glob pattern
|
|
|
const nonGrabPagePathPatterns = pagePathPatterns.filter(pagePathPattern => !isGrobPatternPath(pagePathPattern));
|