Skip to content

Commit 06e9b13

Browse files
committed
Use client ip in Actor
1 parent c28377f commit 06e9b13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/aikido/zen/actor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def self.from_json(data)
6565
def initialize(
6666
id:,
6767
name: nil,
68-
ip: Aikido::Zen.current_context&.request&.ip,
68+
ip: Aikido::Zen.current_context&.request&.client_ip,
6969
first_seen_at: Time.now.utc,
7070
last_seen_at: first_seen_at
7171
)
@@ -96,7 +96,7 @@ def ip
9696
# always keep the most recent time if this conflicts with the current
9797
# value.
9898
# @return [void]
99-
def update(seen_at: Time.now.utc, ip: Aikido::Zen.current_context&.request&.ip)
99+
def update(seen_at: Time.now.utc, ip: Aikido::Zen.current_context&.request&.client_ip)
100100
@last_seen_at.try_update { |last_seen_at| [last_seen_at, seen_at].max }
101101
@ip.try_update { |last_ip| [ip, last_ip].compact.first }
102102
end

0 commit comments

Comments
 (0)