Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e56d2d69cd |
+12
@@ -101,6 +101,18 @@ async fn generate(opts: &GlobalOpts) -> Result<(), Error> {
|
||||
|
||||
#[debug_handler]
|
||||
async fn handler(req: Request) -> impl IntoResponse {
|
||||
println!("{req:?}");
|
||||
let host = req
|
||||
.headers()
|
||||
.iter()
|
||||
.find(|(name, _)| header::HOST.eq(name))
|
||||
.map(|(_, value)| value)
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap();
|
||||
|
||||
println!("{host}");
|
||||
|
||||
let Some(path) = req.uri().path().strip_prefix("/") else {
|
||||
return StatusCode::BAD_REQUEST.into_response();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user