[wp-hackers] wp_remote_get() fails but wget works?

Mike Walsh mpwalsh8 at gmail.com
Mon Feb 4 14:46:36 UTC 2013


My WordPress Google Form plugin utilizes wp_remote_get() to retrieve the
contents of a Google Form and render it as part of a WordPress post or
page.  This has worked well for quite sometime.  Last week Google updated
Google Forms.  In addition to changing the UI and adding some new features,
the format of the published URL changed.  This should not have been an
issue as there wasn't anything specific about the URL my plugin was
dependent on.

However, my plugin no longer works with any newly Google Form that uses the
new URL.  I receive a "Too many redirects" error from wp_remote_get().

[04-Feb-2013 12:51:58 UTC] Array
(
    [0] =>
https://docs.google.com/forms/d/1bPgvlQ-zwdVVBmmLEC0YtUu-yf94rshDLbMPcUFbsCU/viewform
    [1] => Array
        (
            [sslverify] =>
            [timeout] => 30
            [redirection] => 10
        )

    [2] => WP_Error Object
        (
            [errors] => Array
                (
                    [http_request_failed] => Array
                        (
                            [0] => Too many redirects.
                        )

                )

            [error_data] => Array
                (
                )

        )

)

What is odd is that I am able to retrieve the form content using the Unix
wget command line utility. I am concerned I may be facing a situation where
Google views my request as a XSS request as this appears in the response:

[x-xss-protection] => 1; mode=block

I've been digging through WP_Http all morning trying to identify what might
be different and what I can do about it.  I am stumped.  I have posted the
log from WP_Http, the log from wget, and the results from wget to PasteBin
in hopes that someone who understands this lower level stuff better than I
do may have some ideas.


   1. wp_remote_get Log:  http://pastebin.com/WwnZiEB2
   2. wget Log: http://pastebin.com/jKMFbCpG
   3. wget Results:  http://pastebin.com/4FAeuei0

Thanks,

Mike
-- 
Mike Walsh - mpwalsh8 at gmail.com


More information about the wp-hackers mailing list