xssbook/src/console.rs

13 lines
356 B
Rust
Raw Normal View History

2023-01-27 21:04:04 +00:00
use std::net::IpAddr;
use axum::http::{Method, Uri};
pub async fn log(ip: &IpAddr, method: &Method, uri: &Uri, path: Option<&str>, body: Option<&str>) {
if path.is_some() && body.is_some() {
println!("{} {} {}{} {}", ip, method, path.unwrap(), uri, body.unwrap());
} else {
println!("{} {} {}", ip, method, uri);
}
}