mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 10:27:42 +02:00
Panic on wildcard in Cors builder's allowed_origin() (#114)
* Assert allowed origin in Cors builder * Add panic test for wildcard * Add changelog entry * rustfmt * Apply suggestions from code review Co-authored-by: Rob Ede <robjtede@icloud.com> Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
@ -10,6 +10,17 @@ use regex::bytes::Regex;
|
||||
|
||||
use actix_cors::Cors;
|
||||
|
||||
#[actix_rt::test]
|
||||
#[should_panic]
|
||||
async fn test_wildcard_origin() {
|
||||
Cors::new()
|
||||
.allowed_origin("*")
|
||||
.finish()
|
||||
.new_transform(test::ok_service())
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_not_allowed_origin_fn() {
|
||||
let mut cors = Cors::new()
|
||||
|
Reference in New Issue
Block a user