@@ -98,6 +98,9 @@ pub struct Cli {
98
98
99
99
/// Size for local cache
100
100
pub query_cache_size : u64 ,
101
+
102
+ /// CORS behaviour
103
+ pub cors : bool ,
101
104
}
102
105
103
106
impl Cli {
@@ -130,6 +133,7 @@ impl Cli {
130
133
pub const DEFAULT_USERNAME : & ' static str = "admin" ;
131
134
pub const DEFAULT_PASSWORD : & ' static str = "admin" ;
132
135
pub const FLIGHT_PORT : & ' static str = "flight-port" ;
136
+ pub const CORS : & ' static str = "cors" ;
133
137
134
138
pub fn local_stream_data_path ( & self , stream_name : & str ) -> PathBuf {
135
139
self . local_staging_path . join ( stream_name)
@@ -316,6 +320,16 @@ impl Cli {
316
320
. value_parser ( value_parser ! ( u16 ) )
317
321
. help ( "Port for Arrow Flight Querying Engine" ) ,
318
322
)
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
+ )
319
333
. arg (
320
334
Arg :: new ( Self :: LIVETAIL_CAPACITY )
321
335
. long ( Self :: LIVETAIL_CAPACITY )
@@ -451,6 +465,10 @@ impl FromArgMatches for Cli {
451
465
. get_one :: < u16 > ( Self :: FLIGHT_PORT )
452
466
. cloned ( )
453
467
. expect ( "default for flight port" ) ;
468
+ self . cors = m
469
+ . get_one :: < bool > ( Self :: CORS )
470
+ . cloned ( )
471
+ . expect ( "default for CORS" ) ;
454
472
self . livetail_channel_capacity = m
455
473
. get_one :: < usize > ( Self :: LIVETAIL_CAPACITY )
456
474
. cloned ( )
0 commit comments