Skip to content

Commit

Permalink
Removing CORs from prometheus server
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Oct 14, 2024
1 parent 31acb3b commit 75ef23e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions bin/autobahn-router/src/prometheus_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use axum::{routing, Router};
use prometheus::{Encoder, TextEncoder};
use tokio::net::{TcpListener, ToSocketAddrs};
use tokio::task::JoinHandle;
use tower_http::cors::{AllowHeaders, AllowMethods, Any, CorsLayer};
use tracing::{error, info};

use crate::server::errors::AppError;
Expand Down Expand Up @@ -39,13 +38,6 @@ impl PrometheusSync {
let mut router: Router<()> = Router::new();
router = router.route("/metrics", routing::get(Self::get_prometheus_stream));

let cors = CorsLayer::new()
.allow_methods(AllowMethods::any())
.allow_headers(AllowHeaders::any())
.allow_origin(Any);

router = router.layer(cors);

let handle = axum::serve(listener, router);

info!("Prometheus Server started");
Expand Down

0 comments on commit 75ef23e

Please sign in to comment.