ae_reverse_proxy 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16363841f049212788944ea11d19e68b4e534c923f69044d0498d0f706ee1afe
4
- data.tar.gz: d6a78eeafc1bfa35e169c7957ddc4d3ef1802391f6c6d6bfafeb569f688b7918
3
+ metadata.gz: e369f39c4e28d9ddfae0bb90e384fd87f5a580cd2a071748ab89a3439cdf88a5
4
+ data.tar.gz: 051450a4740a954fd046a17ea500c8066b757e244a024ca2fa12cbdeea314bad
5
5
  SHA512:
6
- metadata.gz: 47f2e4306d00723961f2dd6ea021eca167914518b361f3fec4791941807f441a7938b5dc6e8a2fc998b30ae2c8b76f8cd44275ac2d63b412b7b49f550732d8b6
7
- data.tar.gz: 35f8ffdb21e828ae8076edc83be6501693cbf2fff570dd5096dbd55f489c2863e280553332cce5c315a8a619f29e8eb5f54a063d145ce654851ed9041ff9fe54
6
+ metadata.gz: 8df59d583f53d20df40658308d66837f037644141133e9906a4a4ecbd03d210f9b3c6ec77ce1d8cf02c58949a6dc49cd1340b297a85cf24530cff24395e774bb
7
+ data.tar.gz: 8595f6586839ba4386ad652ac5c556ff139dfdc0127552ec7a6f8eb3cd1246b06e52d906cda35cea79032ca73e2ad6ca363424c12a7b19f066201a02a4cbfe79
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2021-2024 AppFolio, Inc
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,21 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'lib/ae_reverse_proxy'
3
+ require_relative 'lib/ae_reverse_proxy/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = 'ae_reverse_proxy'
7
- spec.version = AeReverseProxy::VERSION
8
- spec.platform = Gem::Platform::RUBY
9
- spec.authors = ['Appfolio']
10
- spec.email = ['opensource@appfolio.com']
11
- spec.summary = 'Gem for reverse proxying requests.'
12
- spec.description = spec.summary
13
- spec.license = 'MIT'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
15
- spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|Gemfile$|Rakefile|README.md|.*gemspec)}] }
16
- spec.require_paths = ['lib']
6
+ spec.name = 'ae_reverse_proxy'
7
+ spec.version = AeReverseProxy::VERSION
8
+ spec.platform = Gem::Platform::RUBY
9
+ spec.author = 'AppFolio'
10
+ spec.email = 'opensource@appfolio.com'
11
+ spec.description = 'Gem for reverse proxying requests.'
12
+ spec.summary = spec.description
13
+ spec.homepage = 'https://github.com/appfolio/ae_reverse_proxy'
14
+ spec.license = 'MIT'
15
+ spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|LICENSE.txt|.*gemspec)}] }
16
+ spec.require_paths = ['lib']
17
+
18
+ spec.required_ruby_version = Gem::Requirement.new('< 3.4')
17
19
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
20
 
19
- spec.add_runtime_dependency('addressable', '>= 2.3.6')
20
- spec.add_runtime_dependency('rack', '~> 2.2.3')
21
+ spec.add_dependency('addressable', ['>= 2.3.6', '< 3'])
22
+ spec.add_dependency('rack', ['>= 2.2.3', '< 4'])
21
23
  end
@@ -118,12 +118,16 @@ module AeReverseProxy
118
118
  env
119
119
  .reject { |k, v| !(/^HTTP_[A-Z_]+$/ === k) || k == 'HTTP_VERSION' || v.nil? }
120
120
  .map { |k, v| [reconstruct_header_name(k), v] }
121
- .each_with_object(Rack::Utils::HeaderHash.new) do |k_v, hash|
121
+ .each_with_object(headers.new) do |k_v, hash|
122
122
  k, v = k_v
123
123
  hash[k] = v
124
124
  end
125
125
  end
126
126
 
127
+ def headers
128
+ Rack.release >= '3' ? Rack::Headers : Rack::Utils::HeaderHash
129
+ end
130
+
127
131
  def reconstruct_header_name(name)
128
132
  name.sub(/^HTTP_/, '').gsub('_', '-')
129
133
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AeReverseProxy
4
+ VERSION = '2.2.0'
5
+ end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AeReverseProxy
4
- VERSION = '2.0.0'
5
4
  autoload :Client, 'ae_reverse_proxy/client'
6
5
  autoload :ControllerCallbackMethod, 'ae_reverse_proxy/controller_callback_method'
7
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_reverse_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Appfolio
7
+ - AppFolio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-18 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.3.6
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,35 +27,42 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 2.3.6
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rack
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
39
  version: 2.2.3
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '4'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
39
48
  - !ruby/object:Gem::Version
40
49
  version: 2.2.3
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '4'
41
53
  description: Gem for reverse proxying requests.
42
- email:
43
- - opensource@appfolio.com
54
+ email: opensource@appfolio.com
44
55
  executables: []
45
56
  extensions: []
46
57
  extra_rdoc_files: []
47
58
  files:
48
- - Gemfile
49
- - README.md
50
- - Rakefile
59
+ - LICENSE.txt
51
60
  - ae_reverse_proxy.gemspec
52
61
  - lib/ae_reverse_proxy.rb
53
62
  - lib/ae_reverse_proxy/client.rb
54
63
  - lib/ae_reverse_proxy/controller_callback_method.rb
55
- homepage:
64
+ - lib/ae_reverse_proxy/version.rb
65
+ homepage: https://github.com/appfolio/ae_reverse_proxy
56
66
  licenses:
57
67
  - MIT
58
68
  metadata:
@@ -63,16 +73,16 @@ require_paths:
63
73
  - lib
64
74
  required_ruby_version: !ruby/object:Gem::Requirement
65
75
  requirements:
66
- - - ">="
76
+ - - "<"
67
77
  - !ruby/object:Gem::Version
68
- version: 2.4.0
78
+ version: '3.4'
69
79
  required_rubygems_version: !ruby/object:Gem::Requirement
70
80
  requirements:
71
81
  - - ">="
72
82
  - !ruby/object:Gem::Version
73
83
  version: '0'
74
84
  requirements: []
75
- rubygems_version: 3.0.3
85
+ rubygems_version: 3.5.3
76
86
  signing_key:
77
87
  specification_version: 4
78
88
  summary: Gem for reverse proxying requests.
data/Gemfile DELETED
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org' do
4
- group :test, :development do
5
- gem 'bundler', '>= 1.10.4', '< 3'
6
- gem 'minitest', '>= 5.8', '< 6'
7
- gem 'mocha', '>= 1.11', '< 2'
8
- gem 'pry'
9
- gem 'rake', '>= 13', '< 14'
10
- gem 'rubocop', '~> 1.8', require: false
11
- gem 'webmock', '~> 3.11.1'
12
- end
13
- end
14
-
15
- gemspec
data/README.md DELETED
@@ -1,41 +0,0 @@
1
- # AeReverseProxy
2
-
3
- A reverse proxy accepts a request from a client, forwards it to a server that can fulfill it, and returns the server's response to the client
4
-
5
- This is forked from https://github.com/axsuul/rails-reverse-proxy. Thanks to https://github.com/axsuul and contributors.
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'ae_reverse_proxy'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle install
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install ae_reverse_proxy
22
-
23
- Use it in a console with:
24
-
25
- $ ./console
26
-
27
- ## Usage
28
-
29
- ```ruby
30
- class ImageController < ActionController::Base
31
- include AeReverseProxy::ControllerCallbackMethod
32
-
33
- before_action do
34
- reverse_proxy('https://www.another_server.com')
35
- end
36
- end
37
- ```
38
-
39
- ## License
40
-
41
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rake/testtask'
5
-
6
- Rake::TestTask.new(:test) do |t|
7
- t.libs << 'test'
8
- t.libs << 'lib'
9
- t.test_files = FileList['test/**/*_test.rb']
10
- end
11
-
12
- task default: %i[test]