mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 10:04:12 +02:00
route match improvements
This commit is contained in:
parent
a7a8bf60da
commit
d24f83727c
1 changed files with 5 additions and 1 deletions
|
|
@ -59,7 +59,11 @@ pub fn match_url<'a>(verb: &str, url: &'a str) -> Option<RouteMatch<'a>> {
|
||||||
return Some(RouteMatch::Public(first, parts.next().unwrap_or_default()));
|
return Some(RouteMatch::Public(first, parts.next().unwrap_or_default()));
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = url.split_once('?').map(|(url, _)| url).unwrap_or(url);
|
let url = url
|
||||||
|
.split_once('?')
|
||||||
|
.map(|(url, _)| url)
|
||||||
|
.unwrap_or(url)
|
||||||
|
.trim_end_matches('/');
|
||||||
let (router, url) = if let Some(ocs_url) = url.strip_prefix("/ocs/v2.php") {
|
let (router, url) = if let Some(ocs_url) = url.strip_prefix("/ocs/v2.php") {
|
||||||
(get_ocs_router(verb)?, ocs_url)
|
(get_ocs_router(verb)?, ocs_url)
|
||||||
} else if let Some(ocs_url) = url.strip_prefix("/ocs/v1.php") {
|
} else if let Some(ocs_url) = url.strip_prefix("/ocs/v1.php") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue