fix: update CORS middleware to correctly match public API endpoints
Deploy Application / deploy (push) Successful in 46s
Details
Deploy Application / deploy (push) Successful in 46s
Details
This commit is contained in:
parent
b8f05e501a
commit
21fa8cec4d
|
|
@ -27,9 +27,9 @@ const CORS_CACHE_TTL_MS =
|
|||
app.use((req, res, next) => {
|
||||
// Check if this is a public API endpoint that should allow any origin
|
||||
const isPublicAPIEndpoint =
|
||||
req.path.match(/^\/[^\/]+\/transfer-va\/(inquiry|payment)$/) ||
|
||||
req.path.match(/^\/[^\/]+\/access-token\/b2b$/) ||
|
||||
req.path.match(/^\/[^\/]+\/utilities\/signature-service$/);
|
||||
req.path.match(/^\/api\/[^\/]+\/transfer-va\/(inquiry|payment)$/) ||
|
||||
req.path.match(/^\/api\/[^\/]+\/access-token\/b2b$/) ||
|
||||
req.path.match(/^\/api\/[^\/]+\/utilities\/signature-service$/);
|
||||
if (isPublicAPIEndpoint) {
|
||||
// Allow any origin for public API endpoints
|
||||
const publicCorsOptions = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue