WebmasterID logoWebmasterID
Geo traffic

Trusted country headers from the edge

A country header is only trustworthy if your own edge or CDN sets it. Any geo header that a client could supply can be forged, so trusting it is a security mistake. This page explains how to distinguish edge-set headers from client-supplied ones and how to handle them safely.

Verified against primary sources

Trust the edge, not the client

Your edge or CDN computes a country from the connecting IP and attaches it before your application sees the request. Because it is set inside your trust boundary and overwrites anything the client sent, that value is safe to read as a coarse estimate.

A geo header that simply arrives on the inbound request — one a client could set — is different. Any client can put any country in such a header, so it is attacker-controllable input, not a fact.

Handling geo headers safely

Confirm that your edge strips or overwrites client-supplied geo headers so an inbound value cannot reach your app untouched. Read country only from the header your edge sets, and treat any other geo header as untrusted input.

This is a security note as much as a data-quality one: trusting a forgeable header can let a request misrepresent its origin to your application.

How it appears in analytics and logs

A country header set by your edge is derived from the connecting IP under your control and is a usable coarse estimate. A geo header that arrives from the client is attacker-controllable input and must not be trusted.

Diagnostic use case

Decide which country header to trust by ensuring it is set by your own edge or CDN, and reject any geo value a client could have supplied.

What WebmasterID can help detect

WebmasterID relies on country signals derived at the edge under your control, not on client-supplied geo headers, so the geo it records cannot be forged by a request claiming a country.

Common mistakes

Privacy and accuracy notes

Even a trusted edge country header is a coarse, privacy-safe estimate, not an exact location. WebmasterID uses only edge-derived country signals and never stores raw client IPs in your analytics.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.