Skip to content

Commit b323e69

Browse files
committed
Limit user agent
1 parent 2034e1b commit b323e69

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ Metrics/MethodLength:
679679
Description: Avoid methods longer than 10 lines of code.
680680
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
681681
Enabled: true
682-
Max: 6
682+
Max: 7
683683
Exclude:
684684
- 'db/**/*'
685685

app/models/active_insights/request.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ def self.setup(started, finished, unique_id, payload)
77

88
create!(started_at: started, ip_address: req.remote_ip,
99
finished_at: finished, uuid: unique_id,
10-
http_method: payload[:method], user_agent: req.user_agent,
10+
http_method: payload[:method],
11+
user_agent: req.user_agent.to_s.first(255),
1112
**payload.slice(:controller, :action, :format, :status,
1213
:view_runtime, :db_runtime, :path))
1314
end

0 commit comments

Comments
 (0)