mirror of
https://codeberg.org/icewind/tasproxy.git
synced 2026-06-03 18:24:08 +02:00
allow using - instead of _
This commit is contained in:
parent
5084011305
commit
dd852013a8
1 changed files with 4 additions and 1 deletions
|
|
@ -57,7 +57,10 @@ async fn main() -> Result<()> {
|
||||||
None => return Err(warp::reject::not_found()),
|
None => return Err(warp::reject::not_found()),
|
||||||
};
|
};
|
||||||
let requested_device = host.as_str().split('.').next().unwrap();
|
let requested_device = host.as_str().split('.').next().unwrap();
|
||||||
if let Some(state) = states.get(requested_device) {
|
if let Some(state) = states
|
||||||
|
.get(requested_device)
|
||||||
|
.or_else(|| states.get(&requested_device.replace('-', "_")))
|
||||||
|
{
|
||||||
if let Some(ip) = state.ip {
|
if let Some(ip) = state.ip {
|
||||||
Ok((format!("http://{}", ip), String::new()))
|
Ok((format!("http://{}", ip), String::new()))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue