Skip to content

Commit

Permalink
Force wp-api.js (via Backbone settings) to use HTTP/1.0 methods only. (
Browse files Browse the repository at this point in the history
  • Loading branch information
pento committed Jan 14, 2018
1 parent 9fe1ddc commit 8ee2b1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,12 @@ function gutenberg_extend_wp_api_backbone_client() {
wp_json_encode( $schema_response->get_data() )
), 'before' );
}

/*
* For API requests to happen over HTTP/1.0 methods,
* as HTTP/1.1 methods are blocked in a variety of situations.
*/
wp_add_inline_script( 'wp-api', 'Backbone.emulateHTTP = true;', 'before' );
}

/**
Expand Down

0 comments on commit 8ee2b1a

Please sign in to comment.