#Validating Ray ID
13 messages · Page 1 of 1 (latest)
For example if Cf-Ray is 230b030023ae2822-SJC will it consistently be structured like this and contain as many characters as this?
No, the structure isn't guaranteed to that degree and if you rely on it then your application may break years down the line
OK. Do you potentially have a suggestion as to how I can verify that the value is indeed a valid Ray ID provided by CF?
I dont believe you can, unless you have an Enterprise product like http logpush setup on the zone to do a rayid lookup in (but even then you'd hardly be able to do it for every single request)
Is your code going to be running in the request/response flow of some website, like a web server or such?
If the request comes from a Cloudflare IP address then it's probably reasonable to assume the ray id is correct
Specifically one of these https://www.cloudflare.com/en-gb/ips/
Ah, that could be a good combination. Thank you Erisa!
The above is correct, but I'll add - there isn't really such a thing as an "invalid" ray ID, it's more or less just an integer. It has no real meaning beyond being something you can find in logs, if any logs exist.
230b030023ae2822-SJC is the funnest looking integer ive ever seen (yes I know)