Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#50369 closed enhancement (fixed)

Add `Link` to Access-Control-Expose-Headers

Reported by: toro_unit's profile Toro_Unit Owned by: timothyblynjacobs's profile TimothyBlynJacobs
Milestone: 5.5 Priority: normal
Severity: normal Version: 4.4
Component: REST API Keywords: has-patch
Focuses: rest-api Cc:



Cannot get a link to the next page for a cross-origin request.

As a result, fetchAllMiddleware will not work properly.

Attachments (1)

50369.2.diff (726 bytes) - added by Toro_Unit 4 years ago.

Download all attachments as: .zip

Change History (6)

4 years ago

#1 @ayeshrajans
4 years ago

Looks go to me 👍

#3 @TimothyBlynJacobs
4 years ago

  • Milestone changed from Awaiting Review to 5.5
  • Version changed from trunk to 4.4

#4 @TimothyBlynJacobs
4 years ago

  • Owner set to TimothyBlynJacobs
  • Resolution set to fixed
  • Status changed from new to closed

In 48112:

REST API: Add "Link" to the list of exposed cors headers.

Currently, only the X-WP-Total and X-WP-TotalPages headers are exposed which means that clients have to manually construct the URL to implement pagination instead of using the "prev" and "next" Links.

Additionally, a filter "rest_exposed_cors_headers" is introduced to make it simpler for plugins to expose additional headers.

Props Toro_Unit, ayeshrajans.
Fixes #50369.

#5 @TimothyBlynJacobs
4 years ago

Thanks for the patch!

Note: See TracTickets for help on using tickets.