WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 3 months ago

Last modified 3 months ago

#50369 closed enhancement (fixed)

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

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

Description

see: https://github.com/WordPress/gutenberg/pull/22878

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 months ago.

Download all attachments as: .zip

Change History (6)

@Toro_Unit
4 months ago

#1 @ayeshrajans
4 months ago

Looks go to me 👍

#3 @TimothyBlynJacobs
3 months ago

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

#4 @TimothyBlynJacobs
3 months 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
3 months ago

Thanks for the patch!

Note: See TracTickets for help on using tickets.