Enum hyper::header::AccessControlAllowOrigin [] [src]

pub enum AccessControlAllowOrigin {
    Any,
    Null,
    Value(String),
}

The Access-Control-Allow-Origin response header, part of CORS

The Access-Control-Allow-Origin header indicates whether a resource can be shared based by returning the value of the Origin request header, "*", or "null" in the response.

ABNF

Access-Control-Allow-Origin = "Access-Control-Allow-Origin" ":" origin-list-or-null | "*"

Example values

Examples

use hyper::header::{Headers, AccessControlAllowOrigin};

let mut headers = Headers::new();
headers.set(
    AccessControlAllowOrigin::Any
);
use hyper::header::{Headers, AccessControlAllowOrigin};

let mut headers = Headers::new();
headers.set(
    AccessControlAllowOrigin::Null,
);
use hyper::header::{Headers, AccessControlAllowOrigin};

let mut headers = Headers::new();
headers.set(
    AccessControlAllowOrigin::Value("http://hyper.rs".to_owned())
);

Variants

Allow all origins

A hidden origin

Allow one particular origin