Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Avoid using "PUT" or "DELETE" HTTP methods #1934

Closed
@DanReyLop

Description

Originally discussed in woocommerce/woocommerce#23155

The WooCommerce REST API uses all the HTTP verbs (GET, POST, PUT, DELETE). Also, we've found (props @dechov for the find) that WooCommerce Admin is already relying on some PUT REST endpoints. Here, for example.

In WooCommerce Services, we've had user reports in the past regarding endpoints like those. An apache2 server, with mod_security configured with the most popular set of settings, will forbid any PUT or DELETE HTTP requests to hit the server at all.

Here's the issue, with more context: Automattic/woocommerce-services#930

Gutenberg fixed the same issue here: WordPress/gutenberg#4396 and here: WordPress/gutenberg#5741

Basically, the fix is to change all PUT requests that com from the client to POST requests with a X-HTTP-Method-Override: PUT HTTP header, or a _method=PUT querystring arg. Same with DELETE or PATCH requests.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions