1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-04-20 06:54:46 +00:00

cors tests

This commit is contained in:
Dominic 2020-05-15 21:19:26 +02:00
parent f20c768d02
commit 74ef0af512
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
4 changed files with 160 additions and 10 deletions

View file

@ -166,7 +166,7 @@ pub fn handle_cors(state : &State, res : &mut Response<Body>)
let config = CorsConfig::try_borrow_from(state);
let headers = res.headers_mut();
// non-preflight requests require nothing other than the Access-Control-Allow-Origin header
// non-preflight requests require the Access-Control-Allow-Origin header
if let Some(header) = config.and_then(|cfg| cfg.origin.header_value(state))
{
headers.insert(ACCESS_CONTROL_ALLOW_ORIGIN, header);