Enum rocket_http::hyper::header::AccessControlAllowOrigin [−][src]
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 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
Value(String)
Allow one particular origin
Tuple Fields of Value
0: String
Trait Implementations
Performs the conversion.
Returns the name of the header field this belongs to. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for AccessControlAllowOrigin
impl Send for AccessControlAllowOrigin
impl Sync for AccessControlAllowOrigin
impl Unpin for AccessControlAllowOrigin
impl UnwindSafe for AccessControlAllowOrigin
Blanket Implementations
Mutably borrows from an owned value. Read more