1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-15 09:50:06 +00:00

chore: quick fix

This commit is contained in:
Saad Jutt
2022-07-05 05:30:13 +05:00
parent 7edb47a4cb
commit 1108d3dd7b

View File

@@ -21,11 +21,15 @@ export const getAuthorizedRoutes = () => {
export const getUri = (req: Request) => { export const getUri = (req: Request) => {
const { baseUrl, path: reqPath } = req const { baseUrl, path: reqPath } = req
if (baseUrl === '/AppStream') {
const appStream = reqPath.split('/')[1] const appStream = reqPath.split('/')[1]
// removing trailing slash of URLs // removing trailing slash of URLs
return (baseUrl + '/' + appStream).replace(/\/$/, '') return (baseUrl + '/' + appStream).replace(/\/$/, '')
} }
return baseUrl + reqPath
}
export const isAuthorizingRoute = (req: Request): boolean => export const isAuthorizingRoute = (req: Request): boolean =>
getAuthorizedRoutes().includes(getUri(req)) getAuthorizedRoutes().includes(getUri(req))