0xblackbird
02/22/2023, 10:58 AM0xblackbird
02/22/2023, 11:01 AMsathoro
02/22/2023, 11:06 AMsathoro
02/22/2023, 11:09 AMsathoro
02/22/2023, 11:11 AMsathoro
02/22/2023, 11:14 AMsathoro
02/22/2023, 11:16 AMTheNinthSky
02/22/2023, 12:52 PMnew URL('https://proxy.com/https://my-server.com').pathname
returns
/https:/my-server.com
instead of
/https://my-server.com
kian
02/22/2023, 12:53 PMTheNinthSky
02/22/2023, 12:55 PMkian
02/22/2023, 12:56 PMkian
02/22/2023, 12:56 PMTheNinthSky
02/22/2023, 12:58 PMsathoro
02/22/2023, 1:13 PMsathoro
02/22/2023, 1:13 PMSkye
02/22/2023, 1:37 PMSkye
02/22/2023, 1:37 PMsathoro
02/22/2023, 2:59 PMrequest.headers.get("cf-connecting-ip").length === 39
Plotzes
02/22/2023, 3:00 PM2744::3846
but also
4747:39f2:3847::4847
kian
02/22/2023, 3:01 PMHardAtWork
02/22/2023, 3:01 PMkian
02/22/2023, 3:01 PM2a06:98c0:3600::103
is 19
chars for examplesathoro
02/22/2023, 3:03 PMHardAtWork
02/22/2023, 3:04 PMsathoro
02/22/2023, 3:04 PMsathoro
02/22/2023, 3:04 PMjs
export const getIPForRateLimiting = (request) => {
let ip = request.headers.get("cf-connecting-ip");
// is ipv6
if (ip.length === 39) {
// get the /64 section for rate limiting purposes
return ip.substr(0, 19);
}
return ip;
};
HardAtWork
02/22/2023, 3:05 PMHardAtWork
02/22/2023, 3:05 PMjs
export const getIPForRateLimiting = (request) => {
let ip = request.headers.get("cf-connecting-ip");
// is ipv6
if (ip.includes(":")) {
// get the /64 section for rate limiting purposes
return ip.substr(0, 19);
}
return ip;
};
HardAtWork
02/22/2023, 3:06 PMHardAtWork
02/22/2023, 3:06 PM