jsdelivr / globalping-probe

The globalping probe code that runs on your hardware and connects to the global community network of probes
https://globalping.io
87 stars 21 forks source link

Add OPTIONS as an allowed HTTP Method #261

Open Vittitow opened 3 days ago

Vittitow commented 3 days ago

HTTP probes support GET and HEAD today. I can see why POST isn't supported but I don't see a reason why OPTIONS couldn't be supported as it's pretty much equivalent to HEAD. Lots of sites block HEAD requests but allow OPTIONS for browser CORS compatibility.

jimaek commented 3 days ago

Hey, I don't see why not, but it would also be helpful to better understand your use case. For example are you trying to use HEAD to measure latency and getting blocked?

Vittitow commented 3 days ago

Correct, I'm currently using HEAD requests to just measure latency from different geos to try and avoid putting any load on the sites. I'm getting a 403 Forbidden response so technically not completely blocked and it kind of still works for my use case but, I feel it would be better if we could use OPTIONS which would return a 200. Especially in the case of sites that use Cloudflare or any type of WAF for that matter. They can block HEAD requests before it actually makes it to the origin server making the latency measurement inaccurate.