You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[arg(help = "access id that is expected to sign urls for this server")]
@@ -32,6 +32,24 @@ struct Args {
32
32
help = "disables the bytes transferred monitoring. This feature is experimental, because hyper does not put things easy for tracking IO results in the responses, and the current implementation might have some performance implications. https://github.com/hyperium/hyper/issues/2181"
33
33
)]
34
34
no_bytes_monitor:bool,
35
+
36
+
#[arg(
37
+
long,
38
+
help = "sets the Access-Control-Allow-Origin that will be answered in each request"
39
+
)]
40
+
access_control_allow_origin:Option<String>,
41
+
42
+
#[arg(
43
+
long,
44
+
help = "sets the Access-Control-Allow-Methods that will be answered in each request"
45
+
)]
46
+
access_control_allow_methods:Option<String>,
47
+
48
+
#[arg(
49
+
long,
50
+
help = "sets the Access-Control-Allow-Headers that will be answered in each request"
51
+
)]
52
+
access_control_allow_headers:Option<String>,
35
53
}
36
54
37
55
structConfig{
@@ -98,14 +116,24 @@ impl OnBytesTransferred for BytesTransferredLogger {
98
116
99
117
#[tokio::main]
100
118
asyncfnmain() -> anyhow::Result<()>{
101
-
let args:Args = Args::parse();
102
-
let disable_monitoring = args.no_bytes_monitor;
103
-
let config:Config = args.try_into()?;
104
119
tracing_subscriber::fmt().json().init();
120
+
121
+
let args:Args = Args::parse();
122
+
let config:Config = args.clone().try_into()?;
105
123
letmut server = SignwayServer::from_env(config);
106
-
if !disable_monitoring {
124
+
125
+
if !args.no_bytes_monitor{
107
126
server = server.on_bytes_transferred(BytesTransferredLogger{});
0 commit comments