/// Enable cross-origin resource sharing for given response.
Enable cross-origin resource sharing for given response.
Enable cross - origin resource sharing for given response .
fn enable_cors(&self, res: &mut Response) {
        if self.args.cors {
            res.headers_mut()
                .typed_insert(AccessControlAllowOrigin::ANY);
            res.headers_mut().typed_insert(
                vec![
                    hyper::header::RANGE,
                    hyper::header::CONTENT_TYPE,
                    hyper::header::ACCEPT,
                    hyper::header::ORIGIN,
                ]
                .into_iter()
                .collect::<AccessControlAllowHeaders>(),
            );
        }
    }
fn enable_cors ( & self , res : & mut Response ) { if self . args . cors { res . headers_mut ( ) . typed_insert ( AccessControlAllowOrigin :: ANY ) ; res . headers_mut ( ) . typed_insert ( vec ! [ hyper header RANGE hyper header CONTENT_TYPE hyper header ACCEPT hyper header ORIGIN ] . into_iter ( ) . collect :: < AccessControlAllowHeaders > ( ) , ) ; } }
Enable cross-origin resource sharing for given response.
Enable cross - origin resource sharing for given response .
&self
res
&mut Response