Skip to content

Commit 12a7a5c

Browse files
author
Inbal Tako
committed
Support hanami extraction
1 parent 85d7c4e commit 12a7a5c

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/context/hanami_context.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def self.get_method(request)
3333

3434
def self.get_headers(request)
3535
begin
36-
request.headers.to_h
36+
# Note: At the moment we're filtering out everything but user-agent since ruby's payload is way too big
37+
{ 'user-agent' => request.env['HTTP_USER_AGENT'] }
3738
rescue StandardError
3839
nil
3940
end

lib/context/rails_context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def self.get_method(request)
3636
def self.get_headers(request)
3737
begin
3838
# Note: At the moment we're filtering out everything but user-agent since ruby's payload is way too big
39-
{"user-agent" => request.headers['HTTP_USER_AGENT']}
39+
{ 'user-agent' => request.env['HTTP_USER_AGENT'] }
4040
rescue StandardError
4141
nil
4242
end

lib/context/sinatra_context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def self.get_method(request)
3434
def self.get_headers(request)
3535
begin
3636
# Note: At the moment we're filtering out everything but user-agent since ruby's payload is way too big
37-
{"user-agent" => request.env['HTTP_USER_AGENT']}
37+
{ 'user-agent' => request.env['HTTP_USER_AGENT'] }
3838
rescue StandardError
3939
nil
4040
end

0 commit comments

Comments
 (0)