mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
draft request router
This commit is contained in:
parent
3a227e5d57
commit
e0ecb8ed8a
1 changed files with 16 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue