Opened 8 months ago
Closed 3 months ago
#35580 closed enhancement (fixed)
Include auto-discovery header on REST responses
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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.
8 months ago
#2
@danielbachhuber
8 months ago
- Owner set to joehoyle
- Status changed from new to assigned
This ticket was mentioned in Slack in #core by jorbin. View the logs.
7 months ago
#5
@rmccue
7 months ago
- Owner changed from joehoyle to rmccue
- Status changed from assigned to reviewing
This ticket was mentioned in Slack in #core by mike. View the logs.
7 months ago
#7
@mikeschroder
7 months ago
- Milestone changed from 4.5 to Future Release
Punting this. Too late for 4.5 beta.
#8
@danielbachhuber
3 months ago
- Milestone changed from Future Release to 4.6
@rmccue Can you land this pretty please?
#9
@rachelbaker
3 months ago
- Owner changed from rmccue to rachelbaker
#10
@rachelbaker
3 months ago
@danielbachhuber Picking this up to try and land in 4.6
#11
@rachelbaker
3 months 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.
#12
@rachelbaker
3 months ago
- Keywords commit added
This ticket was mentioned in Slack in #core by ocean90. View the logs.
3 months ago
#14
@danielbachhuber
3 months 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
@rachelbaker
3 months 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.
#16
@rachelbaker
3 months ago
- Resolution set to fixed
- Status changed from reviewing to closed
In 37903:
Header should be included on admin responses too