Automattic\WooCommerce\StoreApi

Authentication::is_preflightprotectedWC 1.0

Is the request a preflight request? Checks the request method

Method of the class: Authentication{}

No Hooks.

Returns

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_preflight();

Authentication::is_preflight() code WC 10.6.2

protected function is_preflight() {
	return isset( $_SERVER['REQUEST_METHOD'], $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'], $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'], $_SERVER['HTTP_ORIGIN'] ) && 'OPTIONS' === $_SERVER['REQUEST_METHOD'];
}