Enum iron::headers::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

Trait Implementations

impl Debug for AccessControlAllowOrigin

Formats the value using the given formatter.

impl PartialEq<AccessControlAllowOrigin> for AccessControlAllowOrigin

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for AccessControlAllowOrigin

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Header for AccessControlAllowOrigin

Returns the name of the header field this belongs to. Read more

Parse a header from a raw stream of bytes. Read more

impl HeaderFormat for AccessControlAllowOrigin

Format a header to be output into a TcpStream. Read more

impl Display for AccessControlAllowOrigin

Formats the value using the given formatter.