bizside 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 898525e0f8554857afa269a915fe53aa320939057fdef98e708474b5de2a483d
4
- data.tar.gz: dcda38e428e11696f8b73aa1f0c97c9237ef5f645c72a3fb2e2e28fd0f9cb5ec
3
+ metadata.gz: 3252985492fd4c1d9d071dcc563ed42a46381d3decfc818c7f8ec23e3dc6216c
4
+ data.tar.gz: 736dc39d2df0a2c801796dee3e3d4fa1289a95e36f7731beb607f94b04ff0e74
5
5
  SHA512:
6
- metadata.gz: 6ff88ef25f3b947a6b05dd9dd035ee1a4bdd609e79061221134b344084dc8ccd9b6e0694ba9575238bd07e1239e463c3cde6fdd30992c2095bf46b50e5427f17
7
- data.tar.gz: f5fdeab08ca7d708c0ac0bc746fe90f3f98d5159755a98c49fa4d086097324f9be3f5c5a994c43f434b8cd4cbfbff89503e3c3473048c4b2fc29e287a55c8b0b
6
+ metadata.gz: 5e09f18238981afe43cff1bc25416521e822f8442a0cdbd3bdc5842792493edd4a1a86baabfef4f518d603304184cb675c00800e6adb3005a3a61d2c95951acb
7
+ data.tar.gz: d7a20214bdc6fd9c43ff7663e875e2eefb1083491794c0ca51caa5d75c553264b165da661628d160cd29ec3b7edadefae32e164918ffe9be1dad08db1101cf93
@@ -82,7 +82,7 @@ module Bizside
82
82
  referrer: env['HTTP_REFERER'],
83
83
  request_method: env['REQUEST_METHOD'],
84
84
  request_uri: env['BIZSIDE_REQUEST_URI'].presence || env['REQUEST_URI'],
85
- remote_address: env['REMOTE_ADDR'],
85
+ remote_address: to_client_ip(env['HTTP_X_FORWARDED_FOR']) || to_client_ip(env['HTTP_CLIENT_IP']) || env['REMOTE_ADDR'],
86
86
  status: status,
87
87
  started_at: start,
88
88
  finished_at: stop,
@@ -180,5 +180,11 @@ module Bizside
180
180
  exception.backtrace.join("\n")[0...truncate_length]
181
181
  end
182
182
 
183
+ # 信頼のおけるロードバランサーがプロキシーになっている前提で、各HTTPヘッダの先頭のIPをクライアントIPとして取得する
184
+ def to_client_ip(header_value)
185
+ ips = header_value ? header_value.strip.split(/[,\s]+/) : []
186
+ ips.first
187
+ end
188
+
183
189
  end
184
190
  end
@@ -1,3 +1,3 @@
1
1
  module Bizside
2
- VERSION = '3.0.1'
2
+ VERSION = '3.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bizside
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - bizside-developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-10 00:00:00.000000000 Z
11
+ date: 2024-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -368,7 +368,7 @@ dependencies:
368
368
  version: 1.5.0
369
369
  description: Bizside is an utilities to assist building web application.
370
370
  email:
371
- - bizside-developers@lab.acs-jp.com
371
+ - bizside-developers@bizside.biz
372
372
  executables: []
373
373
  extensions: []
374
374
  extra_rdoc_files: []
@@ -475,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
475
475
  - !ruby/object:Gem::Version
476
476
  version: '0'
477
477
  requirements: []
478
- rubygems_version: 3.1.6
478
+ rubygems_version: 3.4.22
479
479
  signing_key:
480
480
  specification_version: 4
481
481
  summary: Bizside is an utilities for web application.