mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 07:54:14 +00:00
draft request router
This commit is contained in:
parent
3a227e5d57
commit
e0ecb8ed8a
@ -46,10 +46,24 @@ impl Page {
|
||||
/*let _uri = */
|
||||
match Uri::parse(&request_text, UriFlags::NONE) {
|
||||
Ok(uri) => {
|
||||
println!("Parsed URI: {}", uri); // @TODO
|
||||
// Route request by scheme
|
||||
match uri.scheme().as_str() {
|
||||
"file" => {
|
||||
todo!()
|
||||
}
|
||||
"gemini" => {
|
||||
todo!()
|
||||
}
|
||||
"nex" => {
|
||||
todo!()
|
||||
}
|
||||
scheme => {
|
||||
println!("Protocol {scheme} not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(_) => {
|
||||
// Try interpret host manually
|
||||
// Try interpret URI manually
|
||||
if Regex::match_simple(
|
||||
r"^[^\/\s]+\.[\w]{2,}",
|
||||
request_text.clone(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user