Requests icon indicating copy to clipboard operation
Requests copied to clipboard

Referer isn't consistently set across transports

Open rmccue opened this issue 9 years ago • 4 comments

The referer is set for cURL, but not for sockets, as far as I know.

rmccue avatar Aug 19 '16 12:08 rmccue

Why is the referer set to same URL being requested?

It's apparently causing some trouble in WordPress, see https://core.trac.wordpress.org/ticket/37820

swissspidy avatar Aug 25 '16 11:08 swissspidy

It does this because SimplePie did it, and Requests took compatibility hints from there. It's been in there since forever.

We should change this to be a parameter, default it to '', and use the history stuff as well.

rmccue avatar Aug 30 '16 03:08 rmccue

IMO you shouldn't set the referer header at all. It's optional in the HTTP spec, and in fact "MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such as input from the user keyboard"

porcospino avatar Oct 06 '16 12:10 porcospino

Anything currently preventing this from being changed?

tnorthcutt avatar Feb 13 '18 03:02 tnorthcutt