Instead of a while loop, you can call `allowedDomains.indexOf(requestingOrigin)` to get the array index you need