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
null
*
http://google.com/
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(String)
Allow one particular origin
Trait Implementations
impl Debug for AccessControlAllowOrigin
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl PartialEq<AccessControlAllowOrigin> for AccessControlAllowOrigin
fn eq(&self, __arg_0: &AccessControlAllowOrigin) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AccessControlAllowOrigin) -> bool
This method tests for !=
.
impl Clone for AccessControlAllowOrigin
fn clone(&self) -> AccessControlAllowOrigin
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Header for AccessControlAllowOrigin
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
fn parse_header(raw: &[Vec<u8>]) -> Result<AccessControlAllowOrigin, Error>
Parse a header from a raw stream of bytes. Read more
impl HeaderFormat for AccessControlAllowOrigin
fn fmt_header(&self, f: &mut Formatter) -> Result<(), Error>
Format a header to be output into a TcpStream. Read more