pub struct Cors { /* private fields */ }Expand description
跨域
Implementations§
source§impl Cors
impl Cors
sourcepub fn allow_origin(self, origin: &str) -> Self
pub fn allow_origin(self, origin: &str) -> Self
设置限制域名
sourcepub fn allow_methods(self, methods: &str) -> Self
pub fn allow_methods(self, methods: &str) -> Self
设置请求类型
sourcepub fn allow_headers(self, headers: &str) -> Self
pub fn allow_headers(self, headers: &str) -> Self
设置请求头允许的字段
sourcepub fn allow_credentials(self, open: bool) -> Self
pub fn allow_credentials(self, open: bool) -> Self
设置请求头允许Cookie