Skip to content

Commit cfd7620

Browse files
authored
Fix regex for safari (#1131)
* Fix regex for safari * Minor cleanup
1 parent 37527d1 commit cfd7620

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/mgt-components/src/graph/graph.files.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,9 +1069,12 @@ export async function fetchNextAndCacheForFilesPageIterator(filesPageIterator) {
10691069
if (getIsFileListsCacheEnabled()) {
10701070
let cache: CacheStore<CacheFileList>;
10711071
cache = CacheService.getCache<CacheFileList>(schemas.fileLists, schemas.fileLists.stores.fileLists);
1072-
const reg = /(?<=graph.microsoft.com\/(v1.0|beta))(.*?)(?=\?)/gi; // match only the endpoint (after version number and before OData query params) e.g. /me/drive/root/children
1073-
const key = reg.exec(nextLink);
10741072

1075-
cache.putValue(key[0], { files: filesPageIterator.value, nextLink: filesPageIterator._nextLink });
1073+
// match only the endpoint (after version number and before OData query params) e.g. /me/drive/root/children
1074+
const reg = /(graph.microsoft.com\/(v1.0|beta))(.*?)(?=\?)/gi;
1075+
const matches = reg.exec(nextLink);
1076+
const key = matches[3];
1077+
1078+
cache.putValue(key, { files: filesPageIterator.value, nextLink: filesPageIterator._nextLink });
10761079
}
10771080
}

0 commit comments

Comments
 (0)