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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for AccessControlAllowOrigin
[src]

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

This method tests for !=.

impl Debug for AccessControlAllowOrigin
[src]

Formats the value using the given formatter. Read more

impl Header for AccessControlAllowOrigin
[src]

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

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

Format a header to outgoing stream. Read more

impl Display for AccessControlAllowOrigin
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for AccessControlAllowOrigin

impl Sync for AccessControlAllowOrigin