apply_filters( 'rest_allowed_cors_headers', string[] $allow_headers )

Filters the list of request headers that are allowed for CORS requests.


Description Description

The allowed headers are passed to the browser to specify which headers can be passed to the REST API. By default, we allow the Content-* headers needed to upload files to the media endpoints. As well as the Authorization and Nonce headers for allowing authentication.


Top ↑

Parameters Parameters

$allow_headers

(string[]) The list of headers to allow.


Top ↑

Source Source

File: wp-includes/rest-api/class-wp-rest-server.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.