Merge pull request #382 from fettpl/fix/356-gateway-error-leaks
fix(security): stop leaking serde parse details in gateway error responses
This commit is contained in:
commit
9fbd8c7f57
1 changed files with 2 additions and 1 deletions
|
|
@ -469,8 +469,9 @@ async fn handle_webhook(
|
||||||
let Json(webhook_body) = match body {
|
let Json(webhook_body) = match body {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
tracing::warn!("Webhook JSON parse error: {e}");
|
||||||
let err = serde_json::json!({
|
let err = serde_json::json!({
|
||||||
"error": format!("Invalid JSON: {e}. Expected: {{\"message\": \"...\"}}")
|
"error": "Invalid JSON body. Expected: {\"message\": \"...\"}"
|
||||||
});
|
});
|
||||||
return (StatusCode::BAD_REQUEST, Json(err));
|
return (StatusCode::BAD_REQUEST, Json(err));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue