Skip to content

Commit 976fcde

Browse files
committed
Add header value to cause for blocked traffic
1 parent e6318bf commit 976fcde

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/middleware/block_traffic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ impl Handler for BlockTraffic {
4747
.iter()
4848
.any(|value| self.blocked_values.iter().any(|v| v == value));
4949
if has_blocked_value {
50-
super::log_request::add_custom_metadata(req, "cause", "blocked");
50+
let cause = format!("blocked due to contents of header {}", self.header_name);
51+
super::log_request::add_custom_metadata(req, "cause", cause);
5152
let body = format!(
5253
"We are unable to process your request at this time. \
5354
This usually means that you are in violation of our crawler \

0 commit comments

Comments
 (0)