Skip to content

Instantly share code, notes, and snippets.

@pierrevalade
Created April 13, 2019 10:18
Show Gist options
  • Save pierrevalade/85bbe1e5278b81813e08e7ed9a76250b to your computer and use it in GitHub Desktop.
Save pierrevalade/85bbe1e5278b81813e08e7ed9a76250b to your computer and use it in GitHub Desktop.
addEventListener('fetch', event => {
event.respondWith(hideUserIp(event.request))
})
async function hideUserIp(request) {
let headers = new Headers()
headers.set('content-type', request.headers.get('content-type'))
var response = await fetch(request.url, {headers: headers, method: request.method, body: request.body})
return response
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment