Browse Source

really verify allowedDomains and

replace the for loop
tags/0.2.0
florian 2 years ago
parent
commit
5748c2a3d8
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      routes/index.js

+ 6
- 6
routes/index.js View File

@@ -46,13 +46,13 @@ router.post('/', function (req, res) {
headers: headers}).json()

// verify that the domain is in our list of allowed domains
// FIXME that is actually not true - we're just verifying whether it is a configured domain for the systemm
// take care - no don't - fix this!!
var foundDomain = -1
for (var i = 0; i < body.length; i++) {
if (wantedDomain == body[i].domain) {
foundDomain = i
}
var configuredDomains = body.map (function (x) {
return x.domain
})

if (allowedDomains.includes(wantedDomain)) {
foundDomain = configuredDomains.indexOf(wantedDomain)
}

if (foundDomain > -1) {


Loading…
Cancel
Save