Filters the list of request headers that are allowed for REST API CORS requests.
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.
426* @since 5.5.0427* @since 6.3.0 The `$request` parameter was added.428*429* @param string[]$allow_headers The list of request headers to allow.430* @param WP_REST_Request$request The request in context.431*/432$allow_headers=apply_filters('rest_allowed_cors_headers',$allow_headers,$request);433434$this->send_header('Access-Control-Allow-Headers',implode(', ',$allow_headers));435436$result=$this->check_authentication();437438if(!is_wp_error($result)){
History
Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.