mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-23 15:50:07 +08:00
Fix path construction: use req.path directly for whitelist check
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
0bae11def6
commit
8bff4202c7
|
|
@ -84,7 +84,7 @@ export default ({ app }: { app: Application }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const originPath = `${config.baseUrl}${req.path === '/' ? '' : req.path}`;
|
const originPath = req.path;
|
||||||
if (
|
if (
|
||||||
!headerToken &&
|
!headerToken &&
|
||||||
originPath &&
|
originPath &&
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,8 @@ const apiWhiteListBase = [
|
||||||
'/api/user/notification/init',
|
'/api/user/notification/init',
|
||||||
];
|
];
|
||||||
|
|
||||||
const apiWhiteList = config.baseUrl
|
// Only modify paths if baseUrl is set and not the default '/'
|
||||||
|
const apiWhiteList = config.baseUrl && config.baseUrl !== '/'
|
||||||
? apiWhiteListBase.map(path => `${config.baseUrl}${path.replace(/^\//, '')}`)
|
? apiWhiteListBase.map(path => `${config.baseUrl}${path.replace(/^\//, '')}`)
|
||||||
: apiWhiteListBase;
|
: apiWhiteListBase;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user