Ipstenu / varnish-http-purge

Proxy Cache Purge
Apache License 2.0
46 stars 47 forks source link

WP 4.6 Issue: PURGE being sent as GET #19

Closed Ipstenu closed 8 years ago

Ipstenu commented 8 years ago

I'm having a weird issue with the new requests WP_Http API. I usually run this:

$response = wp_remote_request($purgeme, array('method' => 'PURGE', 'headers' => array( 'host' => $p['host'], 'X-Purge-Method' => $varnish_x_purgemethod ) ) );

But it no longer passes through a method of PURGE, so the whole thing fails. I can't see how to properly use a custom method with the new system. It defaults to a GET now which ... not what I wanted.

GET /
GET /feed/
GET /2016/07/dsafdsaf/
GET /feed/rdf/
GET /feed/rss/
GET /feed/
GET /feed/
GET /feed/atom/
GET /comments/feed/
GET /2016/07/dsafdsaf/feed/

Those should all be PURGE and not GET.

Similarly, when I do a full flush, I get this: GET /.*

I've reached out to @rmccue and @ocean90 via WP Slack.

Ipstenu commented 8 years ago

Determined to be a bug in WP where there's no proper fail.

See https://core.trac.wordpress.org/ticket/37503 and https://github.com/rmccue/Requests/pull/227/

Ipstenu commented 8 years ago

Fixed in core :D