Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-04-28 08:04:40 +0300
committerStan Hu <stanhu@gmail.com>2016-04-28 08:12:55 +0300
commite99cf05875af4627e532fee77bd22574dde240d7 (patch)
treefff4014cf37f8817eac67d039a0ee35701338ac8 /lib/api
parentc01ff1f54b55a60f7c7473d0d8a429d5cf9c1609 (diff)
Use ActionDispatch Remote IP for Akismet checking
Previously all remote IPs appeared at 127.0.0.1, which made Akismet not very useful. Using the ActionDispatch Remote IP (http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html) should provide more reliable results. Closes #16629
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/issues.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 8aa08fd5acc..40928749481 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -24,8 +24,8 @@ module API
def create_spam_log(project, current_user, attrs)
params = attrs.merge({
- source_ip: env['REMOTE_ADDR'],
- user_agent: env['HTTP_USER_AGENT'],
+ source_ip: client_ip(env),
+ user_agent: user_agent(env),
noteable_type: 'Issue',
via_api: true
})