Created
April 13, 2019 10:18
-
-
Save pierrevalade/85bbe1e5278b81813e08e7ed9a76250b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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