@websupporter thanks for reporting. We’ve seen this come up a few times, and it doesn’t make sense on the surface but it might have something to do with the wp_remote_post altering the METHOD… Can you please try this again now and let us know what happens?
@websupporter we’ve also just updated the plugin version to 2.3 just today – if you could please update and let us know if the problem is resolved that would be great.
Hi @ryanhungate
thanks for coming back. I tried it.After the update: Now I get a fatal error at the same stage. Reason: wp_remote_post() returns now a WP_Error (“Too many redirects”), while the plugin does not check, if the response is a WP_Error. I tried quickly just to raise the number of allowed redirects to 100, but it still runs into the same problem.
> but it might have something to do with the wp_remote_post altering the METHOD
I tested it now locally too, where I do have the same problem:
Basically this is the response I am getting:
HTTP/1.1 302 Found
Server: nginx
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Cache-Control: no-cache, private
Date: Fri, 01 Nov 2019 07:36:56 GMT
Location: https://woocommerce.mailchimpapp.com/api/finish
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Access-Control-Allow-Headers: Content-Type, Authorization
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url=https://woocommerce.mailchimpapp.com/api/finish" />
<title>Redirecting to https://woocommerce.mailchimpapp.com/api/finish</title>
</head>
<body>
Redirecting to <a href="https://woocommerce.mailchimpapp.com/api/finish">https://woocommerce.mailchimpapp.com/api/finish</a>.
</body>
</html>
Using xDebug, as far as I can see it I am doing a post request as I stop here: https://github.com/WordPress/WordPress/blob/3caaa40fc6aa67a655d8bf714717901a8ab8373e/wp-includes/Requests/Transport/cURL.php#L335
The redirects then of course are GET-Requests.
I hope this helps you. To me the question seems to be why the server responses with this redirect instead of returning the requested data.
-
This reply was modified 4 years, 5 months ago by websupporter.
@websupporter this is really strange – do you have any idea if you’re doing anything to overwrite anything in the curl requests? For instance there is a http_api_curl
action that allows overrides to be made. Since you’re working locally on stuff, I assume you’ve got a code editor that you could do a search for that word and see if another plugin is doing something there?
@websupporter we’ll go ahead and close this out – assuming you’ve been able to connect. If you’re still experiencing this issue, please do reach back out we would like to figure out why this is happening for you.
Hi @ryanhungate,
sorry I didn’t came back. To be honest, I didn’t figure it out, but as there was some time pressure, we went with another solution.
Thanks for your good support!