admin login fixed.
Build & Push / Pipeline Tests (push) Failing after 1m34s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Successful in 56s
Test / API Unit Tests (push) Successful in 1m8s
Test / Homepage Unit Tests (push) Successful in 47s
Test / Carplace Unit Tests (push) Successful in 43s
Test / Admin Unit Tests (push) Successful in 46s
Test / Dashboard Unit Tests (push) Failing after 43s
Test / API Integration Tests (push) Successful in 1m8s
Build & Push / Pipeline Tests (push) Failing after 1m34s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Successful in 56s
Test / API Unit Tests (push) Successful in 1m8s
Test / Homepage Unit Tests (push) Successful in 47s
Test / Carplace Unit Tests (push) Successful in 43s
Test / Admin Unit Tests (push) Successful in 46s
Test / Dashboard Unit Tests (push) Failing after 43s
Test / API Integration Tests (push) Successful in 1m8s
This commit is contained in:
@@ -43,7 +43,21 @@ function isAllowedDevelopmentOrigin(origin: string) {
|
||||
if (process.env.NODE_ENV === 'production') return false
|
||||
try {
|
||||
const url = new URL(origin)
|
||||
return url.protocol === 'http:' && ['localhost', '127.0.0.1'].includes(url.hostname)
|
||||
if (url.protocol !== 'http:') return false
|
||||
|
||||
const trustedDevPorts = new Set(['3000', '3001', '3002', '3004', '4000'])
|
||||
if (!trustedDevPorts.has(url.port)) return false
|
||||
|
||||
if (['localhost', '127.0.0.1'].includes(url.hostname)) return true
|
||||
|
||||
const octets = url.hostname.split('.').map((part) => Number(part))
|
||||
if (octets.length !== 4 || octets.some((part) => !Number.isInteger(part) || part < 0 || part > 255)) {
|
||||
return false
|
||||
}
|
||||
|
||||
const first = octets[0]!
|
||||
const second = octets[1]!
|
||||
return first === 10 || (first === 172 && second >= 16 && second <= 31) || (first === 192 && second === 168)
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user