Enum edge::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

Any

Allow all origins

Null

A hidden origin

Value

Allow one particular origin

Trait Implementations

impl Header for AccessControlAllowOrigin

fn header_name() -> &'static str

fn parse_header(raw: &[Vec<u8>]) -> Result<AccessControlAllowOrigin, Error>

fn fmt_header(&self, f: &mut Formatter) -> Result<(), Error>

impl Display for AccessControlAllowOrigin

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

Derived Implementations

impl Debug for AccessControlAllowOrigin

fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>

impl PartialEq<AccessControlAllowOrigin> for AccessControlAllowOrigin

fn eq(&self, __arg_0: &AccessControlAllowOrigin) -> bool

fn ne(&self, __arg_0: &AccessControlAllowOrigin) -> bool

impl Clone for AccessControlAllowOrigin

fn clone(&self) -> AccessControlAllowOrigin

1.0.0fn clone_from(&mut self, source: &Self)