[wp-trac] [WordPress Trac] #27498: Canonical redirect is applied upon POST request
WordPress Trac
noreply at wordpress.org
Mon Mar 24 09:41:39 UTC 2014
#27498: Canonical redirect is applied upon POST request
--------------------------+------------------------------
Reporter: c.axelsson | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Canonical | Version: 3.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Changes (by SergeyBiryukov):
* version: trunk => 3.1
Old description:
> If $_POST is empty a canonical redirect is still made even though it
> should be ignored upon all POST requests. As this redirect occurs before
> user have a chance to handle the request themselves in a
> template_redirect filter it prevents users to write proper REST APIs that
> include POST requests with no data.
>
> A patch that uses $_SERVER['REQUEST_METHOD'] instead of relying on the
> $_POST variable to identify request type is attached.
New description:
If `$_POST` is empty a canonical redirect is still made even though it
should be ignored upon all POST requests. As this redirect occurs before
user have a chance to handle the request themselves in a template_redirect
filter it prevents users to write proper REST APIs that include POST
requests with no data.
A patch that uses `$_SERVER['REQUEST_METHOD']` instead of relying on the
`$_POST` variable to identify request type is attached.
--
Comment:
Introduced in [16797].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27498#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list