[wp-trac] [WordPress Trac] #37820: wp_remote_get referrer not being sent correctly
WordPress Trac
noreply at wordpress.org
Thu Aug 25 08:33:30 UTC 2016
#37820: wp_remote_get referrer not being sent correctly
--------------------------+------------------------------
Reporter: schrapel | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: 4.6
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by swissspidy):
Hey there, thanks for your report!
What kind of arguments are you passing to `wp_remote_get()`? Some sample
code to look at would help greatly.
Looking at the code from 4.5 and 4.6, no referer was ever set by WordPress
in 4.5. Now with 4.6, Requests seems to set the referer to the URL being
requested:
{{{#!php
curl_setopt($this->handle, CURLOPT_URL, $url);
curl_setopt($this->handle, CURLOPT_REFERER, $url);
}}}
Citing RFC 2616:
> The Referer[sic] request-header field allows the client to specify, for
the server's benefit, the address (URI) of the resource from which the
Request-URI was obtained
Seems legit in that case.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37820#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list