Skip to content

Commit

Permalink
Log HTTP responses for Proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrendek committed Dec 25, 2016
1 parent 6d96eac commit 0f64b26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/api/logins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ class Api::LoginsController < ApplicationController
def create
body = Oj.load(request.body.read)
ip = request.env['HTTP_X_FORWARDED_FOR'] || request.remote_ip
Rails.logger.info "******************"
Rails.logger.info ip
Rails.logger.info "******************"
if ip.include?(',')
ip = ip.split(', ')[0]
end
honeypot = Honeypot.find_or_create_by(ip: ip)
honeypot.increment!(:logins, 1)
Login.create(body)
Expand Down

0 comments on commit 0f64b26

Please sign in to comment.