fix: add cors option http
This commit is contained in:
+7
-1
@@ -55,7 +55,13 @@ async fn main() {
|
|||||||
|
|
||||||
let cors = CorsLayer::new()
|
let cors = CorsLayer::new()
|
||||||
.allow_origin(cors_origin.parse::<HeaderValue>().unwrap())
|
.allow_origin(cors_origin.parse::<HeaderValue>().unwrap())
|
||||||
.allow_methods([Method::GET, Method::POST, Method::PUT, Method::DELETE])
|
.allow_methods([
|
||||||
|
Method::GET,
|
||||||
|
Method::POST,
|
||||||
|
Method::PUT,
|
||||||
|
Method::DELETE,
|
||||||
|
Method::OPTIONS,
|
||||||
|
])
|
||||||
.allow_headers([
|
.allow_headers([
|
||||||
header::CONTENT_TYPE,
|
header::CONTENT_TYPE,
|
||||||
header::AUTHORIZATION,
|
header::AUTHORIZATION,
|
||||||
|
|||||||
Reference in New Issue
Block a user