Skip to content

Commit 82b7d67

Browse files
committed
add logging
1 parent 73479cd commit 82b7d67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/handlers/micropub.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ pub async fn handle_post(
519519
) -> Result<impl IntoResponse, StatusCode> {
520520
let content_type = headers.get("Content-Type");
521521
let auth = headers.get("Authorization");
522+
info!("micropub post headers: {:?}", headers);
522523

523524
if let None = auth {
524525
return Err(StatusCode::FORBIDDEN);
@@ -555,6 +556,7 @@ pub async fn handle_post(
555556
error!("error reading bytes from body: {:?}", e);
556557
StatusCode::INTERNAL_SERVER_ERROR
557558
})?;
559+
info!("micropub post body: {:?}", body_bytes);
558560
// if content type is json, attempt to decode and see whether this is an action (update/delete)
559561
// or if it's a create.
560562
if let Some(ct) = content_type {
@@ -565,6 +567,7 @@ pub async fn handle_post(
565567
let json_parse_result: serde_json::Result<serde_json::Value> = serde_json::from_slice(body_byte_slice);
566568
match json_parse_result {
567569
Ok(json) => {
570+
info!("micropub post body parsed json: {:?}", json);
568571
if let Some(obj) = json.as_object() {
569572
match obj.get("action") {
570573
Some(serde_json::Value::String(action)) => {

0 commit comments

Comments
 (0)