mirror of
https://github.com/actix/actix-web.git
synced 2024-12-30 12:00:38 +00:00
add error response test for cors
This commit is contained in:
parent
548f6f89bf
commit
bc01d39d4d
1 changed files with 2 additions and 0 deletions
|
@ -871,6 +871,8 @@ mod tests {
|
||||||
|
|
||||||
assert!(cors.inner.validate_allowed_method(&req).is_err());
|
assert!(cors.inner.validate_allowed_method(&req).is_err());
|
||||||
assert!(cors.inner.validate_allowed_headers(&req).is_err());
|
assert!(cors.inner.validate_allowed_headers(&req).is_err());
|
||||||
|
let resp = test::call_success(&mut cors, req);
|
||||||
|
assert_eq!(resp.status(), StatusCode::BAD_REQUEST);
|
||||||
|
|
||||||
let req = TestRequest::with_header("Origin", "https://www.example.com")
|
let req = TestRequest::with_header("Origin", "https://www.example.com")
|
||||||
.header(header::ACCESS_CONTROL_REQUEST_METHOD, "put")
|
.header(header::ACCESS_CONTROL_REQUEST_METHOD, "put")
|
||||||
|
|
Loading…
Reference in a new issue