Skip to content

The referrer header causes strange behavior #224

bellostom opened this Issue Jul 25, 2012 · 4 comments

3 participants


The below feed URL is correct and should be parsed with no problem.

However, passing it to simplepie returns no data.
After a lot of debugging, I saw that the response I got from their server was actually html, which meant
that they redirected my original request for the feed.
Finally, I ended up commenting out the

curl_setopt($fp, CURLOPT_REFERER, $url);

in the SimplePie_File constructor and that fixed the issue.

Apparently, there is some bizarre server side logic on their end also, but I cannot think of a reason why this header is needed.

SimplePie member
skyzyx commented Jul 25, 2012

It gets around cases where sites have Apache rewrite rules that block image "hotlinking" so that SimplePie can cache the images locally. This way, the content can be read as it was intended.

SimplePie member
skyzyx commented Jul 25, 2012

Actually, this feature has been part of SimplePie since 2006, and this is the first time I've heard about an issue with it. Truly bizarre.


Hm. Great insight. Didn't think about that case. Thanks

SimplePie member
rmccue commented Oct 13, 2012

I'm going to close this as invalid for now. If you find any other sites that have this issue, please let me know and I'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.