Enum hyperx::header::AccessControlAllowOrigin
source · pub enum AccessControlAllowOrigin {
Any,
Null,
Value(String),
}
Expand description
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 hyperx::header::{Headers, AccessControlAllowOrigin};
let mut headers = Headers::new();
headers.set(
AccessControlAllowOrigin::Any
);
use hyperx::header::{Headers, AccessControlAllowOrigin};
let mut headers = Headers::new();
headers.set(
AccessControlAllowOrigin::Null,
);
use hyperx::header::{Headers, AccessControlAllowOrigin};
let mut headers = Headers::new();
headers.set(
AccessControlAllowOrigin::Value("http://hyper.rs".to_owned())
);
Variants§
Trait Implementations§
source§impl Clone for AccessControlAllowOrigin
impl Clone for AccessControlAllowOrigin
source§fn clone(&self) -> AccessControlAllowOrigin
fn clone(&self) -> AccessControlAllowOrigin
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AccessControlAllowOrigin
impl Debug for AccessControlAllowOrigin
source§impl Display for AccessControlAllowOrigin
impl Display for AccessControlAllowOrigin
source§impl Header for AccessControlAllowOrigin
impl Header for AccessControlAllowOrigin
source§fn header_name() -> &'static str
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
source§fn parse_header(raw: &Raw) -> Result<AccessControlAllowOrigin>
fn parse_header(raw: &Raw) -> Result<AccessControlAllowOrigin>
Parse a header from a raw stream of bytes. Read more