From 01b06efcfc0e95d3b57cd6d7819b7baa36308fc7 Mon Sep 17 00:00:00 2001 From: Yury Lebedev Date: Fri, 29 Nov 2024 10:38:53 +0100 Subject: [PATCH] Remove fetch from AppSec::Response for getting status_code --- lib/datadog/appsec/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/appsec/response.rb b/lib/datadog/appsec/response.rb index 7acccf31895..8d63fd88622 100644 --- a/lib/datadog/appsec/response.rb +++ b/lib/datadog/appsec/response.rb @@ -87,7 +87,7 @@ def block_response(env, options) body << content(content_type) Response.new( - status: options.fetch('status_code', 403).to_i, + status: options['status_code']&.to_i || 403, headers: { 'Content-Type' => content_type }, body: body, )