mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 05:32:01 +00:00
fix protectedRoutes type error, close #736
This commit is contained in:
+2
-1
@@ -85,9 +85,10 @@ export function getAuthTokenPath(path: string) {
|
|||||||
// Ensure trailing slashes to compare paths component by component. Same for protectedRoutes.
|
// Ensure trailing slashes to compare paths component by component. Same for protectedRoutes.
|
||||||
// Since OneDrive ignores case, lower case before comparing. Same for protectedRoutes.
|
// Since OneDrive ignores case, lower case before comparing. Same for protectedRoutes.
|
||||||
path = path.toLowerCase() + '/'
|
path = path.toLowerCase() + '/'
|
||||||
const protectedRoutes = siteConfig.protectedRoutes
|
const protectedRoutes = siteConfig.protectedRoutes as string[]
|
||||||
let authTokenPath = ''
|
let authTokenPath = ''
|
||||||
for (let r of protectedRoutes) {
|
for (let r of protectedRoutes) {
|
||||||
|
if (typeof r !== 'string') continue
|
||||||
r = r.toLowerCase().replace(/\/$/, '') + '/'
|
r = r.toLowerCase().replace(/\/$/, '') + '/'
|
||||||
if (path.startsWith(r)) {
|
if (path.startsWith(r)) {
|
||||||
authTokenPath = `${r}.password`
|
authTokenPath = `${r}.password`
|
||||||
|
|||||||
Reference in New Issue
Block a user