pub fn allowed_origin(mut self, origin: &str) -> Cors {
        if let Some(cors) = cors(&mut self.cors, &self.error) {
            match Uri::try_from(origin) {
                Ok(_) => {
                    if cors.origins.is_all() {
                        cors.origins = AllOrSome::Some(HashSet::new());
                    }
                    if let AllOrSome::Some(ref mut origins) = cors.origins {
                        origins.insert(origin.to_owned());
                    }
                }
                Err(e) => {
                    self.error = Some(e.into());
                }
            }
        }
        self
    }
/// Add an origin that is allowed to make requests.
///
/// By default, requests from all origins are accepted by CORS logic.
/// This method allows to specify a finite set of origins to verify the
/// value of the `Origin` request header.
///
/// This is the `list of origins` in the
/// [Resource Processing Model](https://www.w3.org/TR/cors/#resource-processing-model).
///
/// When this list is set, the client's `Origin` request header will be
/// checked in a case-sensitive manner.
///
/// When all origins are allowed and `send_wildcard` is set, "*" will be
/// sent in the `Access-Control-Allow-Origin` response header.
/// If `send_wildcard` is not set, the client's `Origin` request header
/// will be echoed back in the `Access-Control-Allow-Origin` response header.
///
/// Builder panics if supplied origin is not valid uri.
Add an origin that is allowed to make requests.
By default, requests from all origins are accepted by CORS logic.
This method allows to specify a finite set of origins to verify the
value of the `Origin` request header.

This is the `list of origins` in the
[Resource Processing Model].

When this list is set, the client's `Origin` request header will be
checked in a case-sensitive manner.

When all origins are allowed and `send_wildcard` is set, "*" will be
sent in the `Access-Control-Allow-Origin` response header.

Builder panics if supplied origin is not valid uri.
Add an origin that is allowed to make requests . By default requests from all origins are accepted by CORS logic . This method allows to specify a finite set of origins to verify the value of the ` Origin ` request header . This is the ` list of origins ` in the [ Resource Processing Model ] . When this list is set the client ' s ` Origin ` request header will be checked in a case - sensitive manner . When all origins are allowed and ` send_wildcard ` is set " * " will be sent in the ` Access - Control - Allow - Origin ` response header . Builder panics if supplied origin is not valid uri .
pub fn allowed_origin(mut self, origin: &str) -> Cors {
        if let Some(cors) = cors(&mut self.cors, &self.error) {
            match Uri::try_from(origin) {
                Ok(_) => {
                    if cors.origins.is_all() {
                        cors.origins = AllOrSome::Some(HashSet::new());
                    }
                    if let AllOrSome::Some(ref mut origins) = cors.origins {
                        origins.insert(origin.to_owned());
                    }
                }
                Err(e) => {
                    self.error = Some(e.into());
                }
            }
        }
        self
    }
pub fn allowed_origin ( mut self , origin : & str ) -> Cors { if let Some ( cors ) = cors ( & mut self . cors , & self . error ) { match Uri :: try_from ( origin ) { Ok ( _ ) => { if cors . origins . is_all ( ) { cors . origins = AllOrSome :: Some ( HashSet :: new ( ) ) ; } if let AllOrSome :: Some ( ref mut origins ) = cors . origins { origins . insert ( origin . to_owned ( ) ) ; } } Err ( e ) => { self . error = Some ( e . into ( ) ) ; } } } self }
Add an origin that is allowed to make requests.
Add an origin that is allowed to make requests .
mut self
origin
&str
mut self
origin
&str