views:

23

answers:

2

Imagine you are on a page whose URL has a fragment (the part after the #), and click a link to go to another page. Most browsers will send the URL of the original page to the server in the Referer header. What I want to know is whether or not the URL fragment will be included in this or not.

I have seen various behaviors in the wild so this might be browser-specific. Does anyone know which browsers do what? And what does the HTTP spec say on this?

+1  A: 

The spec says basicly that you can do whatever you want - it is an optional header, i just tested webkit ignores the fragment, as do firefox and IE.

tobyodavies
+3  A: 

The spec says that Referer can't include a fragment identifier (per ABNF). See RFC 2616, Section 14.36.

Julian Reschke
Does that bear out in practice though? I'm pretty sure I've seen at least some browsers include it.
levik
That would be interesting; if you can reproduce it please follow up on the IETF HTTPbis WG's mailing list.
Julian Reschke