使用 Cloudflare Workers 反向代理 Gravatar 头像

Cloudflare Workers 首页:https://workers.cloudflare.com

//Reverse proxy gravatar avatar
addEventListener("fetch", (event) => {
    let url = new URL(event.request.url);
    url.hostname = "secure.gravatar.com";
    let request = new Request(url, event.request);
    event.respondWith(fetch(request));
});

gravatar 官方地址:https://secure.gravatar.com/avatar/xxx?s=100&d=mm
Cloudflare Workers 反向代理地址:https://<Service Name>.xxx.workers.dev/avatar/xxx?s=100&d=mm