#59722 closed defect (bug) (fixed)
Regression: class-wp-rest-server.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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.
2 years ago
#1
- Keywords has-patch added
#2
@
2 years 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
@
2 years 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.
2 years ago
This ticket was mentioned in Slack in #core by jorbin. View the logs.
2 years ago
#7
@
2 years ago
- Owner set to jorbin
- Resolution set to fixed
- Status changed from new to closed
In 57012:
The
rest_send_nocache_headersblock was moved afterrest_pre_serve_requestin https://github.com/WordPress/WordPress/commit/3f1e6a6a5031b319fd5ebfaaf6598fec3fe78fb1.This renders
rest_pre_serve_requestuseless becauserest_send_nocache_headerssends / removes http headers. As a result, usingrest_pre_serve_requestfor it's intended purpose (to manually send the request) results in:Cannot modify header information - headers already sent.Suggest moving the
rest_send_nocache_headersblock before therest_pre_serve_requestfilter.Trac ticket: https://core.trac.wordpress.org/ticket/59722#ticket