Merge pull request #8439 from kilbot/patch-3

Allow HTTP method to be overwritten by HTTP_X_HTTP_METHOD_OVERRIDE
This commit is contained in:
Claudio Sanches 2015-06-23 11:47:12 -03:00
commit 6d3979f5d7
1 changed files with 2 additions and 0 deletions

View File

@ -133,6 +133,8 @@ class WC_API_Server {
// Compatibility for clients that can't use PUT/PATCH/DELETE
if ( isset( $_GET['_method'] ) ) {
$this->method = strtoupper( $_GET['_method'] );
} elseif ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) {
$this->method = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];
}
// load response handler