summaryrefslogtreecommitdiff
path: root/src/types/extract.rs
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2023-01-28 11:52:32 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2023-01-28 11:52:32 -0500
commit487d97cb019ef1a37d3ef90c6b051ba0389c6d15 (patch)
tree16833c40f95c917a48ddb7f97c1d75330a8222be /src/types/extract.rs
parentfix rerendering logout button, console page (diff)
downloadxssbook-487d97cb019ef1a37d3ef90c6b051ba0389c6d15.tar.gz
xssbook-487d97cb019ef1a37d3ef90c6b051ba0389c6d15.tar.bz2
xssbook-487d97cb019ef1a37d3ef90c6b051ba0389c6d15.zip
tracing
Diffstat (limited to 'src/types/extract.rs')
-rw-r--r--src/types/extract.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types/extract.rs b/src/types/extract.rs
index 399fe67..69c6ed8 100644
--- a/src/types/extract.rs
+++ b/src/types/extract.rs
@@ -27,6 +27,7 @@ impl<S> FromRequestParts<S> for AuthorizedUser where S: Send + Sync {
};
let Ok(user) = User::from_user_id(session.user_id, true) else {
+ tracing::error!("Valid token but no valid user");
return Err(ResponseCode::InternalServerError.text("Valid token but no valid user"))
};
@@ -84,6 +85,7 @@ impl<T, S, B> FromRequest<S, B> for Json<T> where
async fn from_request(mut req: Request<B>, state: &S) -> Result<Self> {
let Ok(ConnectInfo(info)) = req.extract_parts::<ConnectInfo<SocketAddr>>().await else {
+ tracing::error!("Failed to read connection info");
return Err(ResponseCode::InternalServerError.text("Failed to read connection info"));
};
let method = req.method().clone();
@@ -91,6 +93,7 @@ impl<T, S, B> FromRequest<S, B> for Json<T> where
let uri = req.uri().clone();
let Ok(bytes) = Bytes::from_request(req, state).await else {
+ tracing::error!("Failed to read request body");
return Err(ResponseCode::InternalServerError.text("Failed to read request body"));
};