bizside 2.3.7 → 2.3.8

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: 3e862771bbdfb64ff2afb022531b1250695b8741628eeefbb1e3b04df397cdda
4
- data.tar.gz: e1d399959f57b304de4decd054d21d45e9918bdd8f04a6f78f14e6aa53132827
3
+ metadata.gz: 31a2944a9db2b20cadfe18a6367f9cbcd5c04f5dcf6259e1fd6f5639ac056915
4
+ data.tar.gz: 70dcd0e7746a040d1a60494406b4bedbdfb1b51bccbdcd86d3d54f0bee4844e2
5
5
  SHA512:
6
- metadata.gz: d047094b8f553a82da8ddc19b76dad83cf53b75241614fa29a52213d14d2cb2c20bf1f889f5b663dbc0c56889b40a65c314fa51f89605bae429c79f18359357f
7
- data.tar.gz: e79df9ac71b7c9d7e3bc6df57108fdefadbc9a43bfe5b45181b736880f57c757a3006e9596b336c7418b1fe2e9041467b769de11dfb0b5dd83d4f466a14866c7
6
+ metadata.gz: a06ec66efb74b3c4ed9d34293e4db7b019df45737314135eea676da367f9a7d264bed92bcacd3be13f7835549303fac04b63ab0bdc37ef7a21daf9987ac392f7
7
+ data.tar.gz: cafbf3686937f4b507d57699783d66afe98cd2ad28d9e93711f7ee2009cb3cda2a9a8cd2f1a7ba94892ef870d4343ca56572553c59d5694f89d5e557d45b005a
@@ -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 = '2.3.7'
2
+ VERSION = '2.3.8'
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: 2.3.7
4
+ version: 2.3.8
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-01-17 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
@@ -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.4.19
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.