@@ -98,6 +98,9 @@ pub struct Cli {
9898
9999 /// Size for local cache
100100 pub query_cache_size : u64 ,
101+
102+ /// CORS behaviour
103+ pub cors : bool ,
101104}
102105
103106impl Cli {
@@ -130,6 +133,7 @@ impl Cli {
130133 pub const DEFAULT_USERNAME : & ' static str = "admin" ;
131134 pub const DEFAULT_PASSWORD : & ' static str = "admin" ;
132135 pub const FLIGHT_PORT : & ' static str = "flight-port" ;
136+ pub const CORS : & ' static str = "cors" ;
133137
134138 pub fn local_stream_data_path ( & self , stream_name : & str ) -> PathBuf {
135139 self . local_staging_path . join ( stream_name)
@@ -316,6 +320,16 @@ impl Cli {
316320 . value_parser ( value_parser ! ( u16 ) )
317321 . help ( "Port for Arrow Flight Querying Engine" ) ,
318322 )
323+ . arg (
324+ Arg :: new ( Self :: CORS )
325+ . long ( Self :: CORS )
326+ . env ( "P_CORS" )
327+ . value_name ( "BOOL" )
328+ . required ( false )
329+ . default_value ( "true" )
330+ . value_parser ( value_parser ! ( bool ) )
331+ . help ( "Enable/Disable CORS, default disabled" ) ,
332+ )
319333 . arg (
320334 Arg :: new ( Self :: LIVETAIL_CAPACITY )
321335 . long ( Self :: LIVETAIL_CAPACITY )
@@ -451,6 +465,10 @@ impl FromArgMatches for Cli {
451465 . get_one :: < u16 > ( Self :: FLIGHT_PORT )
452466 . cloned ( )
453467 . expect ( "default for flight port" ) ;
468+ self . cors = m
469+ . get_one :: < bool > ( Self :: CORS )
470+ . cloned ( )
471+ . expect ( "default for CORS" ) ;
454472 self . livetail_channel_capacity = m
455473 . get_one :: < usize > ( Self :: LIVETAIL_CAPACITY )
456474 . cloned ( )
0 commit comments