Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
067a73d982 |
-12
@@ -101,18 +101,6 @@ async fn generate(opts: &GlobalOpts) -> Result<(), Error> {
|
|||||||
|
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
async fn handler(req: Request) -> impl IntoResponse {
|
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 {
|
let Some(path) = req.uri().path().strip_prefix("/") else {
|
||||||
return StatusCode::BAD_REQUEST.into_response();
|
return StatusCode::BAD_REQUEST.into_response();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user