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

Trait Implementations

impl Clone for AccessControlAllowOrigin
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for AccessControlAllowOrigin
[src]

[src]

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

[src]

This method tests for !=.

impl Debug for AccessControlAllowOrigin
[src]

[src]

Formats the value using the given formatter. Read more

impl Header for AccessControlAllowOrigin
[src]

[src]

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

[src]

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

impl HeaderFormat for AccessControlAllowOrigin
[src]

[src]

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

impl Display for AccessControlAllowOrigin
[src]

[src]

Formats the value using the given formatter. Read more