Opened 9 years ago
Closed 8 years ago
#35580 closed enhancement (fixed)
Include auto-discovery header on REST responses
Reported by: | danielbachhuber | Owned by: | rachelbaker |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description
Adds Link
header to REST API responses:
Link: <http://wordpress-develop.dev/wp-json/>; rel="https://api.w.org/"
When a client is attempting to auto-discover the API with a HEAD request, WordPress should always include the Link
header to orient the client.
Attachments (2)
Change History (18)
This ticket was mentioned in Slack in #core-restapi by danielbachhuber. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by jorbin. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by mike. View the logs.
9 years ago
#8
@
8 years ago
- Milestone changed from Future Release to 4.6
@rmccue Can you land this pretty please?
#11
@
8 years ago
- Keywords has-unit-tests added
In 35580.2.diff I added a unit test to check the presence of the Link
header. This looks good to me and unless @rmccue objects I can land this.
This ticket was mentioned in Slack in #core by ocean90. View the logs.
8 years ago
#14
@
8 years ago
@rachelbaker Ryan mentioned adding the header to /wp-admin/
requests too, which makes sense to me. Want to add that as well? Probably could happen in two separate commits.
#15
@
8 years ago
@danielbachhuber Including the link
header for wp-admin
requests could probably be done using rest_output_link_header
, but I don't feel strongly this is needed (rest_output_link_header
already is hooked into template_redirect
also included in dispatched API requests). Of course @rmccue can add if he likes.
Header should be included on admin responses too