Created
November 23, 2022 17:57
-
-
Save nanos/e5e25ef3b1ea9381250a0f3992f0e225 to your computer and use it in GitHub Desktop.
webfinger through CloudFlare Worker
This file contains hidden or 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
/** | |
* 1) Create a worker with the below content, replacing your target account | |
* 2) Assign that worker to the .well-known/webfinger* route on your domain. | |
*/ | |
// Change this to yor target account | |
const account = '[email protected]'; | |
addEventListener("fetch", event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
const domain = account.split('@')[1]; | |
return fetch(new Request(`https://${domain}/.well-known/webfinger?resource=acct:${account}`)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment