Skip to content

Commit

Permalink
Ensure http method is always uppercase
Browse files Browse the repository at this point in the history
Per RFC 7231 HTTP verbs are defined as case-sensitive and standard ones are in uppercase.
See https://www.rfc-editor.org/rfc/rfc7231#section-4.1

Resolves #6
  • Loading branch information
webmat authored and Envek committed Dec 14, 2023
1 parent 717b615 commit 3de1683
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/yabeda/http_requests/sniffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def request(data_item)
{
host: data_item.request.host,
port: data_item.request.port,
method: data_item.request.method
method: data_item.request.method.upcase
}
)
end
Expand All @@ -28,7 +28,7 @@ def log_http_response_total(data_item)
{
host: data_item.request.host,
port: data_item.request.port,
method: data_item.request.method,
method: data_item.request.method.upcase,
status: data_item.response.status
}
)
Expand All @@ -38,7 +38,7 @@ def log_http_response_duration(data_item)
labels = {
host: data_item.request.host,
port: data_item.request.port,
method: data_item.request.method,
method: data_item.request.method.upcase,
status: data_item.response.status
}

Expand Down

0 comments on commit 3de1683

Please sign in to comment.