#59722 closed defect (bug) (fixed)
Regression: class-wp-rest-server.php
Reported by: | perrelet | Owned by: | jorbin |
---|---|---|---|
Milestone: | 6.4 | Priority: | high |
Severity: | major | Version: | 6.4 |
Component: | REST API | Keywords: | has-patch dev-reviewed |
Focuses: | rest-api | Cc: |
Description
In https://github.com/WordPress/WordPress/commit/3f1e6a6a5031b319fd5ebfaaf6598fec3fe78fb1
The rest_send_nocache_headers
block is moved after rest_pre_serve_request
.
However this renders rest_pre_serve_request
useless because rest_send_nocache_headers
sends / removes http headers. As a result, using rest_pre_serve_request
for it's intended purpose (to manually send the request) results in Cannot modify header information - headers already sent
.
Suggest moving the rest_send_nocache_headers
block before the rest_pre_serve_request
filter.
Change History (13)
This ticket was mentioned in PR #5564 on WordPress/wordpress-develop by perrelet.
12 months ago
#1
- Keywords has-patch added
#2
@
12 months ago
- Component changed from General to REST API
- Milestone changed from Awaiting Review to 6.4
Hi there, welcome back to WordPress Trac! Thanks for the report.
Introduced in [56834], moving to the milestone to get more eyes on this.
#3
@
12 months ago
- Priority changed from normal to high
- Summary changed from regression: class-wp-rest-server.php to Regression: class-wp-rest-server.php
Moving up the priority for tracking and awareness.
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
12 months ago
This ticket was mentioned in Slack in #core by jorbin. View the logs.
12 months ago
#7
@
12 months ago
- Owner set to jorbin
- Resolution set to fixed
- Status changed from new to closed
In 57012:
#8
@
12 months ago
- Keywords dev-feedback added
- Resolution fixed deleted
- Status changed from closed to reopened
Thank you @perrelet for identifying this.
Reopening for 2nd committer sign-off to backport to both the 6.4 and 6.3 branches.
#9
@
12 months ago
- Keywords dev-reviewed added; dev-feedback removed
[57012] LGTM for backport to 6.4
The
rest_send_nocache_headers
block was moved afterrest_pre_serve_request
in https://github.com/WordPress/WordPress/commit/3f1e6a6a5031b319fd5ebfaaf6598fec3fe78fb1.This renders
rest_pre_serve_request
useless becauserest_send_nocache_headers
sends / removes http headers. As a result, usingrest_pre_serve_request
for it's intended purpose (to manually send the request) results in:Cannot modify header information - headers already sent.
Suggest moving the
rest_send_nocache_headers
block before therest_pre_serve_request
filter.Trac ticket: https://core.trac.wordpress.org/ticket/59722#ticket