Look at a request header your browser sends: Referer: https://example.com/page. Notice anything off? The English word is referrer, with two r's in the middle. Yet in HTTP the header name is missing one letter, and that misspelling has been used in almost every web request since the 1990s. Why was it never fixed? And why should you care when you write an API?
Where the misspelling started
The Referer header was already in the early HTTP specification in 1992. According to that document, it tells the server the address of the document the requested URI was obtained from, so the server can build back-link lists and trace broken links (Jeff Kaufman: Why "Referer"?).
People only noticed the misspelling long after HTTP was widely used. On March 9, 1995, someone on the HTTP-WG mailing list asked whether anyone had noticed that Referer: is spelled wrong. Roy Fielding replied that it was fine, since the spell program did not recognize either spelling, and "we should just blame it on France" (W3C archive).
Phillip Hallam-Baker answered the next day. He admitted he had also misspelled the name of a newsgroup he created, then wrote: "I think this one is down to Tim", meaning Tim Berners-Lee (W3C archive). But in September 2000 he wrote that the referer spelling was his own choice. The two accounts contradict each other, so who first typed it wrong cannot be settled. Jeff Kaufman judges Hallam-Baker's 1995 memory more reliable than his 2000 one, but that is only an opinion.
Why it was never fixed
Because by the time people noticed, HTTP was already everywhere. Fixing one letter would mean every browser, server, proxy, and log script in the world changing at once. Instead of fixing it, the specifications froze it:
| When | Document | What happened |
|---|---|---|
| 1992 | Basic HTTP | The Referer header first appears in a specification. |
| March 1995 | HTTP-WG mailing list | The misspelling is discussed, then left alone. |
| May 1996 | RFC 1945 (HTTP/1.0) | Defines Referer with the same spelling. |
| 1997 and 1999 | RFC 2068, RFC 2616 (HTTP/1.1) | Adds a [sic] mark. RFC 2616 says "the header field is misspelled". A proposed text fix in erratum 2301 was rejected. |
| 2022 | RFC 9110 (HTTP Semantics) | Still writes "Referer" [sic], "though the field name is misspelled". |
So today the spelling is part of the standard. MDN records it too, calling the header name a misspelling of the word referrer (MDN).
What actually trips you up when writing an API
You live in two spelling worlds at once. According to the Referrer Policy specification and web.dev, Referer (one r) is only the HTTP header name, while Referrer-Policy and document.referrer use the correct spelling (W3C Referrer Policy, web.dev).
// Go: r.Header.Get("Referer") is the same as r.Referer()
ref := r.Referer()
// JavaScript in the browser: correct spelling, two r's
const ref = document.referrer;
// Response header that controls what Referer contains: correct spelling
Referrer-Policy: strict-origin-when-cross-originThe common bug is typing the "correct" spelling when reading the header. The Go developers even wrote a comment in net/http saying the Request.Referer() method exists so the compiler can reject req.Referrer(), whereas it cannot detect Header["Referrer"] (Go source).
A few safe habits:
- Read the header with the HTTP spelling:
Referer. Header names are case-insensitive, but the spelling must still match. - Use
Referrer-Policy(two r's) to control how much of the origin URL gets sent. - Do not base security on
Referer. A client can forge it, and a browser can omit it depending on policy or privacy settings. - Do not log full URLs without thinking. The Referrer Policy specification names privacy as one reason this header needs controlling, for example a user's profile URL leaking to the destination site.
- In API docs and code, write the header name exactly as
Refererso it is easy to search.
Conclusion
One letter missing in 1992 became a header name we still type today. Nothing broke because of it, but it teaches something: a widely used name is almost impossible to change, so choose API names carefully from the start, and read header names exactly as the specification writes them.
References
- Roy Fielding, Re: Referer: (sic) (March 9, 1995, W3C archive)
- Phillip M. Hallam-Baker, Re: Referer: (sic) (March 10, 1995, W3C archive)
- RFC 1945: HTTP/1.0 (May 1996)
- RFC 9110: HTTP Semantics, Referer section
- RFC Errata 2301 (RFC 2616)
- MDN: Referer header
- W3C: Referrer Policy
- web.dev: Referer and Referrer-Policy best practices
- Jeff Kaufman: Why "Referer"? (October 23, 2019)
- Go: net/http request.go
