WordPress at a glance
function is not described

rest_send_cors_headers() WP 4.4.0

Sends Cross-Origin Resource Sharing headers with API requests.

No Hooks.

Return

Mixed. Response data.

Usage

rest_send_cors_headers( $value );
$value(mixed) (required)
Response data.

Code of rest send cors headers: wp-includes/rest-api.php VER 5.0.3

<?php
function rest_send_cors_headers( $value ) {
	$origin = get_http_origin();

	if ( $origin ) {
		// Requests from file:// and data: URLs send "Origin: null"
		if ( 'null' !== $origin ) {
			$origin = esc_url_raw( $origin );
		}
		header( 'Access-Control-Allow-Origin: ' . $origin );
		header( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' );
		header( 'Access-Control-Allow-Credentials: true' );
		header( 'Vary: Origin' );
	}

	return $value;
}