Opened 11 years ago
Closed 10 years ago
#35580 closed enhancement (fixed)
Include auto-discovery header on REST responses
| Reported by: | danielbachhuber | Owned by: | rachelbaker |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.6 |
| Component: | REST API | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests commit |
| Cc: | Focuses: |
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.
11 years ago
This ticket was mentioned in Slack in #core by jorbin. View the logs.
11 years ago
This ticket was mentioned in Slack in #core by mike. View the logs.
11 years ago
#11
@
10 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.
10 years ago
#14
@
10 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
@
10 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Header should be included on admin responses too