Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions bot/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ pub fn welcome_message() -> String {
/singbox <version> <URI> - Process URI for specific version
🔍 Supported versions: 1.11.0, 1.12.0
/xray comming soon ...
"We're currently in beta version !
If you encounter any issues or have feedback,
please let us know
@ip_routes_admin
we appreciate your support!"
"#
.trim()
.replace(" ", "")
Expand Down
8 changes: 7 additions & 1 deletion singbox/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
let host = query
.remove("host")
.map(|h| h.split(',').map(|s| s.trim().to_string()).collect())
.unwrap_or_else(Vec::new);

Check warning on line 377 in singbox/src/protocol/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

use of `unwrap_or_else` to construct default value

warning: use of `unwrap_or_else` to construct default value --> singbox/src/protocol/mod.rs:377:18 | 377 | .unwrap_or_else(Vec::new); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[warn(clippy::unwrap_or_default)]` on by default

let path = query
.remove("path")
Expand All @@ -401,7 +401,13 @@
}
"ws" | "websocket" => Ok(transport::TransportConfig::Websocket {
path: query.remove("path").unwrap_or_default(),
headers: parse_headers(query.remove("headers")),
headers: {
let mut headers = parse_headers(query.remove("headers"));
if let Some(host) = query.remove("host") {
headers.insert("Host".to_string(), host);
}
headers
},
max_early_data: query
.remove("max_early_data")
.and_then(|s| s.parse().ok())
Expand Down
Loading