WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#38546 closed defect (bug) (fixed)

REST API: Add PATCH to CORS allowed methods

Reported by: jnylen0 Owned by: pento
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch
Focuses: Cc:
PR Number:

Description

Currently it is not possible to send a CORS request with the PATCH method, even though this is supported by any "editable" resource in the REST API.

Attachments (1)

38546.diff (565 bytes) - added by jnylen0 3 years ago.

Download all attachments as: .zip

Change History (6)

@jnylen0
3 years ago

#1 @jnylen0
3 years ago

  • Keywords has-patch added

#2 @joehoyle
3 years ago

Nice! I'm remembering there was a good amount of discussion around the use of PATCH, as I *think* there are some different semantics for it - I'm trying to find the github ticket where that was discussed but I'm failing to find it right now. @rmccue @rachelbaker for any help there.

As long as that doesn't impact this, this looks good to me.

#3 @jnylen0
3 years ago

Did a search through the GH issues, and apparently people use the word "patch" a lot when developing OSS ;)

Found this, though... https://github.com/WP-API/WP-API/pull/768#issuecomment-73878867

Actually, our use of PATCH is kind of an abuse of the verb [...] We support it with the same semantics as PUT

#4 @pento
3 years ago

  • Owner set to pento
  • Resolution set to fixed
  • Status changed from new to closed

In 39042:

REST API: Add PATCH to CORS allowed methods.

Editable resources in the REST API accept the PATCH method, but the CORS headers don't mention it.

Props jnylen0.
Fixes #38546.

#5 @rachelbaker
3 years ago

  • Milestone changed from Awaiting Review to 4.7
Note: See TracTickets for help on using tickets.