Skip to content
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
11 changes: 5 additions & 6 deletions server/src/handlers/livetail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use arrow_flight::{
HandshakeResponse, PutResult, SchemaResult, Ticket,
};
use tonic_web::GrpcWebLayer;
use tower_http::cors::{Any, CorsLayer};
use tower_http::cors::{AllowHeaders, AllowMethods, AllowOrigin, CorsLayer};

use crate::livetail::{Message, LIVETAIL};
use crate::metadata::STREAM_INFO;
Expand Down Expand Up @@ -175,11 +175,10 @@ pub fn server() -> impl Future<Output = Result<(), Box<dyn std::error::Error + S
let svc = FlightServiceServer::new(service);

let cors = CorsLayer::new()
// allow `GET` and `POST` when accessing the resource
.allow_methods(Any)
.allow_headers(Any)
.allow_origin(Any);
// allow requests from any origin
.allow_methods(AllowMethods::mirror_request())
.allow_headers(AllowHeaders::mirror_request())
.allow_origin(AllowOrigin::mirror_request())
.allow_credentials(true);

Server::builder()
.accept_http1(true)
Expand Down