Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/aikido/zen/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def normalized_headers

def as_json
{
method: request_method.downcase,
method: request_method,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed HTTP method serialization to use raw request_method (removed .downcase), introducing potential mismatch with consumers expecting lowercase method names.

Details

🔧 How do I fix it?
Trace execution paths carefully. Ensure precondition checks happen before using values, validate ranges before checking impossible conditions, and don't check for states that the code has already ruled out.

More info - Comment @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.

url: url,
ipAddress: client_ip,
userAgent: user_agent,
Expand Down
2 changes: 1 addition & 1 deletion test/aikido/zen/request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module Tests
req = build_request(env)

assert_equal(
{method: "post", url: "http://example.org/test"},
{method: "POST", url: "http://example.org/test"},
req.as_json.slice(:method, :url)
)
end
Expand Down
Loading