is_allowed_http_origin example


function send_origin_headers() {
    $origin = get_http_origin();

    if ( is_allowed_http_origin( $origin ) ) {
        header( 'Access-Control-Allow-Origin: ' . $origin );
        header( 'Access-Control-Allow-Credentials: true' );
        if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) {
            exit;
        }
        return $origin;
    }

    if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) {
        status_header( 403 );
        exit;
    }
Home | Imprint | This part of the site doesn't use cookies.