rails-reverse-proxy 0.11.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +15 -6
- data/VERSION +1 -1
- data/lib/reverse_proxy/client.rb +11 -2
- data/rails-reverse-proxy.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf7252f3d979f055cc3e3877f1db5c0a0d4069c9b322d1faf9b066e6e7b34680
|
4
|
+
data.tar.gz: 8c8099bdb9d362d1d4e081257d56c342464dd07ad77a75ffc11c2a231e63df8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b85fc52c75fd5c55e66993b7ce206f3e7dabf318af9890328b98d6219ec65e4c654534a3d0c437ef04e38129f16b4010695c41651a0459227862daca0871ecc
|
7
|
+
data.tar.gz: 27b6bbfb5f53ad2b0595b36fd203ae8a4e55159130a31ec311a282d422c8b69cab170a28906029ee3f35f052cfb498120a9d632ba97a3a0d0f62ebeec224ba52
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.13.0
|
2
|
+
|
3
|
+
BUG FIXES:
|
4
|
+
|
5
|
+
* **Rack 3 compatibility:** Use `Rack::Headers` if defined (i.e. if using Rack >= 3.0.0), otherwise use `Rack::Utils::HeaderHash` [[#76](https://github.com/axsuul/rails-reverse-proxy/pull/76), [davidrunger](https://github.com/davidrunger)]
|
6
|
+
|
1
7
|
## 0.11.0
|
2
8
|
|
3
9
|
BUG FIXES:
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ gem 'rails-reverse-proxy'
|
|
15
15
|
Then (you guessed it!)
|
16
16
|
|
17
17
|
```
|
18
|
-
$ bundle
|
18
|
+
$ bundle install
|
19
19
|
```
|
20
20
|
|
21
21
|
## Usage
|
@@ -75,6 +75,12 @@ If you'd like to customize options passed into the underlying [`Net:HTTP`](https
|
|
75
75
|
reverse_proxy "http://localhost:8000", http: { read_timeout: 20, open_timeout: 100 }
|
76
76
|
```
|
77
77
|
|
78
|
+
If you'd like to reset the `Accept-Encoding` header in order to disable compression or other server-side encodings
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
reverse_proxy "http://localhost:8000", reset_accept_encoding: true
|
82
|
+
```
|
83
|
+
|
78
84
|
Determine what version you're using
|
79
85
|
|
80
86
|
```ruby
|
@@ -91,10 +97,13 @@ All pull requests will become first class citizens.
|
|
91
97
|
|
92
98
|
Special thanks to our contributors!
|
93
99
|
|
94
|
-
- [
|
95
|
-
- [
|
96
|
-
- [bapirex](https://github.com/bapirex)
|
97
|
-
- [marcosbeirigo](https://github.com/marcosbeirigo)
|
100
|
+
- [aardvarkk](https://github.com/aardvarkk)
|
101
|
+
- [Arjeno](https://github.com/Arjeno)
|
98
102
|
- [avinashkoulavkar](https://github.com/avinashkoulavkar)
|
103
|
+
- [bapirex](https://github.com/bapirex)
|
104
|
+
- [davidrunger](https://github.com/davidrunger)
|
99
105
|
- [jcs](https://github.com/jcs)
|
100
|
-
- [
|
106
|
+
- [kylewlacy](https://github.com/kylewlacy)
|
107
|
+
- [marcosbeirigo](https://github.com/marcosbeirigo)
|
108
|
+
- [mediafinger](https://github.com/mediafinger)
|
109
|
+
- [miyukki](https://github.com/miyukki)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.13.0
|
data/lib/reverse_proxy/client.rb
CHANGED
@@ -3,6 +3,15 @@ require 'addressable/uri'
|
|
3
3
|
|
4
4
|
module ReverseProxy
|
5
5
|
class Client
|
6
|
+
RackHeaders =
|
7
|
+
if Rack.const_defined?('Headers')
|
8
|
+
# Rack >= 3.0.0
|
9
|
+
Rack::Headers
|
10
|
+
else
|
11
|
+
# Rack < 3.0.0
|
12
|
+
Rack::Utils::HeaderHash
|
13
|
+
end
|
14
|
+
|
6
15
|
@@callback_methods = [
|
7
16
|
:on_response,
|
8
17
|
:on_set_cookies,
|
@@ -65,9 +74,9 @@ module ReverseProxy
|
|
65
74
|
&& source_request.body
|
66
75
|
source_request.body.rewind
|
67
76
|
target_request.body_stream = source_request.body
|
77
|
+
target_request.content_length = source_request.content_length || 0
|
68
78
|
end
|
69
79
|
|
70
|
-
target_request.content_length = source_request.content_length || 0
|
71
80
|
target_request.content_type = source_request.content_type if source_request.content_type
|
72
81
|
|
73
82
|
# Hold the response here
|
@@ -132,7 +141,7 @@ module ReverseProxy
|
|
132
141
|
!(/^HTTP_[A-Z_]+$/ === k) || k == "HTTP_VERSION" || v.nil?
|
133
142
|
end.map do |k, v|
|
134
143
|
[reconstruct_header_name(k), v]
|
135
|
-
end.inject(
|
144
|
+
end.inject(RackHeaders.new) do |hash, k_v|
|
136
145
|
k, v = k_v
|
137
146
|
hash[k] = v
|
138
147
|
hash
|
data/rails-reverse-proxy.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: rails-reverse-proxy 0.
|
5
|
+
# stub: rails-reverse-proxy 0.13.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "rails-reverse-proxy".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.13.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["James Hu".freeze]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2024-02-21"
|
15
15
|
s.description = "Reverse proxy for Ruby on Rails".freeze
|
16
16
|
s.email = "hello@james.hu".freeze
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-reverse-proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Hu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|