Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with wordpress #325

Closed
desarrolla2 opened this issue May 19, 2013 · 6 comments
Closed

Problems with wordpress #325

desarrolla2 opened this issue May 19, 2013 · 6 comments

Comments

@desarrolla2
Copy link

Hi for all.

I have the next code

 // any resource from wordpress.com
$resource  = 'http://lavidaestux.wordpress.com/tag/ubuntu/feed/';
$this->client = new \Guzzle\Http\Client();
$request = $this->client->get($resource);
$response = $request->send();

and i have the next error

Guzzle\Http\Exception\CurlException: [curl] 52: Empty reply from server [url] http://lavidaestux.wordpress.com/tag/ubuntu/feed/ [info] array (
'url' => 'http://lavidaestux.wordpress.com/tag/ubuntu/feed/',
'content_type' => NULL,
'http_code' => 0,
'header_size' => 0,
'request_size' => 89,
'filetime' => -1,
'ssl_verify_result' => 0,
'redirect_count' => 0,
'total_time' => 0.329139,
'namelookup_time' => 0.068307,
'connect_time' => 0.198143,
'pretransfer_time' => 0.198189,
'size_upload' => 0,
'size_download' => 0,
'speed_download' => 0,
'speed_upload' => 0,
'download_content_length' => -1,
'upload_content_length' => 0,
'starttransfer_time' => 0.329127,
'redirect_time' => 0,
'certinfo' =>
array (
),
'primary_ip' => '66.155.11.243',
'primary_port' => 80,
'local_ip' => '192.168.1.13',
'local_port' => 60471,
'redirect_url' => '',
) [debug]

Other servers works fine for me.

curl works fine from comand line

curl -I http://lavidaestux.wordpress.com/tag/ubuntu/feed/
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 19 May 2013 21:39:46 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Vary: Accept-Encoding
Vary: Cookie
X-hacker: If you're reading this, you should visit automattic.com/jobs and apply to join the fun, mention this header.
X-Pingback: http://lavidaestux.wordpress.com/xmlrpc.php
Last-Modified: Sat, 11 May 2013 13:56:16 GMT
ETag: "62e37b460cecc3f2f2421776c3de241d"

Any ideas?

Regards!

@mtdowling
Copy link
Member

Hm. Very strange. This server does not respond to any request that contains the exact string and casing of "Guzzle" in the User-Agent header. For example, here's what the User-Agent header of a Guzzle request looks like:

User-Agent: curl/7.21.4 PHP/5.3.15 Guzzle/3.5.2

When I send a request with that header, I get an empty reply from the server. When I modify the User-Agent header to not include the term "Guzzle", I get a 200 OK response. Is it possible that this server has blacklisted the term Guzzle for some reason? I can reproduce this from the command line too:

$ curl -H "User-Agent: curl/7.21.4 PHP/5.3.15 Guzzle/3.5.2" -v http://lavidaestux.wordpress.com/tag/ubuntu/feed/
* About to connect() to lavidaestux.wordpress.com port 80 (#0)
*   Trying 76.74.254.123... connected
* Connected to lavidaestux.wordpress.com (76.74.254.123) port 80 (#0)
> GET /tag/ubuntu/feed/ HTTP/1.1
> Host: lavidaestux.wordpress.com
> Accept: */*
> User-Agent: curl/7.21.4 PHP/5.3.15 Guzzle/3.5.2
> 
* Empty reply from server
* Connection #0 to host lavidaestux.wordpress.com left intact
curl: (52) Empty reply from server
* Closing connection #0

I'd suggest contacting the host to see what the issue is. Have you been grabbing this feed too aggressively perhaps and they blocked you?

@desarrolla2
Copy link
Author

I have not been aggressive, I've done less than 200 requests per day (a different worpress sub domains) to get RSS feeds...

Maybe other Guzzle User did.

@mtdowling
Copy link
Member

Interesting. Well there's nothing I can do from my end. I suggest just changing your User-Agent header.

@Spawnrad
Copy link

Spawnrad commented Sep 5, 2014

I have exactly the same issue when i use User-Agent : Guzzle/4.0

@desarrolla2
Copy link
Author

@maknz
Copy link

maknz commented Oct 28, 2014

What the heck were Wordpress thinking. Just ran into this weird as hell bug. Will submit a report to them.

Update: they've unblacklisted Guzzle, so all should work as normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants