Skip to content

Commit

Permalink
Allow all method types
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyRonning committed Feb 28, 2025
1 parent 006925d commit 6842e7e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ use crate::{
};
use crate::{encrypt::create_new_encryption_key, jwt::validate_jwt};
use aws_credentials::{AwsCredentialManager, AwsCredentials};
use axum::{
http::{Method, StatusCode},
middleware::from_fn_with_state,
response::IntoResponse,
Json,
};
use axum::{http::StatusCode, middleware::from_fn_with_state, response::IntoResponse, Json};
use base64::engine::general_purpose;
use base64::Engine as _;
use chacha20poly1305::aead::Aead;
Expand Down Expand Up @@ -1958,8 +1953,8 @@ async fn main() -> Result<(), Error> {
.await?;

let cors = CorsLayer::new()
// allow `GET` and `POST` when accessing the resource
.allow_methods([Method::GET, Method::POST, Method::PUT, Method::DELETE])
// allow all method types
.allow_methods(Any)
// allow all headers
.allow_headers(Any)
// allow requests from any origin
Expand Down

0 comments on commit 6842e7e

Please sign in to comment.