Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
makemake-kbo committed Mar 14, 2024
1 parent 2843391 commit 858a174
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ma_length = 100
sort_on_startup = true
# Enable health checking
health_check = true
# Enable header checking
# Enable content type header checking
header_check = true
# Acceptable time to wait for a response in ms
ttl = 30
Expand Down
4 changes: 3 additions & 1 deletion src/balancer/accept_http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,10 @@ async fn forward_body(
Result<hyper::Response<Full<Bytes>>, Infallible>,
Option<usize>,
) {
// Check if body has application/json
//
// Can be toggled via the config. Should be on if we want blutgang to be JSON-RPC compliant.
if params.header_check {
// Check if body has application/json
if tx.headers().get("content-type") != Some(&HeaderValue::from_static("application/json")) {
return (
Ok(hyper::Response::builder()
Expand Down

0 comments on commit 858a174

Please sign in to comment.