Products ▾

Solutions ▾

Resources ▾

Developers

Pricing

Sign Up

Log In

Under Attack?

""
,

""

,

          
addEventListener('fetch', event => {
 event.respondWith(fetchAndApply(event.request))
})

async function fetchAndApply(request) {
 if (request.headers.get('user-agent')
 .includes('annoying_robot')) {
   return new Response
   ('Sorry, this page is not available.',
   { status: 403, statusText: 'Forbidden' })
  }
 return fetch(request)
}
          
        

          
addEventListener('fetch', event => {
 event.respondWith(fetchAndApply(event.request))
})

async function fetchAndApply(request) {
 if (request.headers.get('cf-connecting-ip') === '225.0.0.1') {
  return new Response
  ('Sorry, this page is not available.',
  { status: 403, statusText: 'Forbidden' })
 }
 return fetch(request)
}
          
        

"

,