Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick 3ab2c1761ebdbb2a7e2e8c8ff0a24e813289f70f into aptos-release-v1.9 #11694

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions api/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ use crate::{
view_function::ViewFunctionApi,
};
use anyhow::Context as AnyhowContext;
use aptos_api_types::X_APTOS_CLIENT;
use aptos_config::config::{ApiConfig, NodeConfig};
use aptos_logger::info;
use aptos_mempool::MempoolClientSender;
use aptos_storage_interface::DbReader;
use aptos_types::chain_id::ChainId;
use poem::{
handler,
http::{header, Method},
http::Method,
listener::{Listener, RustlsCertificate, RustlsConfig, TcpListener},
middleware::Cors,
web::Html,
Expand Down Expand Up @@ -194,12 +193,7 @@ pub fn attach_poem_to_runtime(
// routing in the LB) we must enable this:
// https://stackoverflow.com/a/24689738/3846032
.allow_credentials(true)
.allow_methods(vec![Method::GET, Method::POST])
.allow_headers(vec![
header::HeaderName::from_static(X_APTOS_CLIENT),
header::CONTENT_TYPE,
header::ACCEPT,
]);
.allow_methods(vec![Method::GET, Method::POST]);

// Build routes for the API
let route = Route::new()
Expand Down
Loading