[wp-trac] [WordPress Trac] #40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't enabled
WordPress Trac
noreply at wordpress.org
Tue May 30 13:23:31 UTC 2017
#40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't
enabled
--------------------------------------+-----------------------------
Reporter: Joen | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: REST API | Version: 4.4
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: rest-api
--------------------------------------+-----------------------------
Comment (by dd32):
While working around the issue isn't out of the question (I'd suggest that
it shouldn't use the `$is_nginx` variable, and should just always return
that, for consistency), I'm a little concerned that
[attachment:40886.diff] makes it seem like `PUT` not working isn't an
expected behaviour.
It's completely an expected behaviour for a server not to accept a non-
GET/HEAD/POST request, it's the exact reason why the
[https://developer.wordpress.org/rest-api/using-the-rest-api/global-
parameters/#_method-or-x-http-method-override-header `method` overrides
are available] in both WordPress and many other api platforms. (Also
because sometimes in-between proxies/etc mangle requests)
Possibly this is something that could/should be handed by `wp.js`? If a
request is rejected with `405 (Not Allowed)` flip the flag and just use
the overrides transparently?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40886#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list