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

Dion Hulse (dd32) wordpress at dd32.id.au
Tue Feb 5 00:07:44 UTC 2013


If I had to guess, I'd say the Cookies are not being respected/applied
for the Redirects, which will most likely cause a redirect loop.
Hopefully that'll send you down the right rabbit hole..

On 5 February 2013 04:57, Anshu Prateek <anshprat at gmail.com> wrote:
> The X-Xss-Protection header is a standard header, that you get even while
> using curl.
>
> http://pastebin.com/SbjSnKFd
>
> Since its complaining about too many redirects, and looking at the logs,
> its getting stuck in the login loop for some reason.
>
> One quick way of checking it would be to write a php script to fetch the
> content from google groups and see if that works fine.
>
>
> regards
> Anshu Prateek
>
>
> On Mon, Feb 4, 2013 at 8:19 PM, Mike Walsh <mpwalsh8 at gmail.com> wrote:
>
>> Sorry for the double posting ... I thought I had lost my draft.
>>
>>
>> On Mon, Feb 4, 2013 at 9:46 AM, Mike Walsh <mpwalsh8 at gmail.com> wrote:
>>
>> > 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
>> >
>>
>>
>>
>> --
>> Mike Walsh - mpwalsh8 at gmail.com
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list