Hi there, is it possible to get the data from the custom list within a worker fetch request?
I have created an IP allowlist in my account (manage account → configuration → lists) and I am now also trying to do some stuff based on those IP’s within the worker. I already found out I could do something like this in the worker code:
export default {
async fetch(request) {
const clientIP = request.headers.get("CF-Connecting-IP");
const ipList = ['1.2.3.4', '1.2.3.5', '1.2.3.6'];
if (ipList.includes(clientIP)) {
// do something when specific IP is spotted
console.log('something');
}
return fetch(request);
},
};
However, I’d like to replace ipList
with the custom list that’s already configured in the account so it can be managed from 1 place.