Worker Maintenance Page Allow Multiple IP's

We have a client that wants us to enable maintenance page for their site and allow multiple IP’s to be allowed to access it while they do their work.

It works fine with just one IP but if I add a second, the 2nd one doesn’t work.

It’s currently setup like this
//Return maint page if you’re not calling from a trusted IP
if (request.headers.get(“cf-connecting-ip”) !== “10.11.12.13”)

According to the code you provide, you’re simply checking if the first part is the same as the second part, which it wouldn’t be, if you’re putting in two IP addresses.

You may want to look in to having a list of addresses, and checking whether the visitor IP is a part of that list, - e.g. something like:

const ALLOWED_IPS = ["192.0.2.4", "198.51.100.200", "203.0.113.226"];
const VISITOR_IP = request.headers.get("CF-Connecting-IP");

if (ALLOWED_IPS.includes(VISITOR_IP) === false) {
  // Someone else tried to join us... :'(
}