rails-reverse-proxy 0.6.1 → 0.7.0

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
  SHA1:
3
- metadata.gz: e6bd7ea23c01e11f9d0a36390b59b4cf858ee808
4
- data.tar.gz: 41e84754f2fe15e633bda9e1a69f16558e43c562
3
+ metadata.gz: 3b360ee4c361f26e4c2182bdd20e4348af835ca7
4
+ data.tar.gz: 73c8d8972c066241ae4834a34148ab6ecebfe33f
5
5
  SHA512:
6
- metadata.gz: 0bcf6a90d2617114375c460a9bb962705504c81bb2e0c3613d947f857256706b344d84c1faaf91cd924bbd5f387e22af8b6c8af3a69532c23704920143fcb1a7
7
- data.tar.gz: cbb88d800f60edc5585f389eb59d3d6dd4d1448606aadfef6b5c64be9d7c75371bab7ca29fb4c65be38fab64b24f4cb0c5097b3d47b2c12704ff74d47cabbd7e
6
+ metadata.gz: afc6bc62f37962e1f6f9022590d2dc6e7f599dd763f76673cc1f4bb6794c7d126ad595294ae3cdb773d56c22070faff0c6282049a264528fc3c77b95b2e872a5
7
+ data.tar.gz: 3a0e28009255950571604c0cc6976b25b37064d077ee908d977c1e0b45f07fc92d5996e8378b2e13d025e7c8ca380529faffe3ad4c37b748673747d566da39f5
data/README.md CHANGED
@@ -58,7 +58,19 @@ You can also pass options into `reverse_proxy`
58
58
  reverse_proxy "http://localhost:8000", path: "custom-path", headers: { 'X-Foo' => "Bar" }
59
59
  ```
60
60
 
61
- Sorry if these instructions are sparse. Feel free to reach out or read the source!
61
+ If you'd like to bypass SSL verification
62
+
63
+ ```ruby
64
+ reverse_proxy "http://localhost:8000", verify_ssl: false
65
+ ```
66
+
67
+ Use this method to determine what version you're running
68
+
69
+ ```ruby
70
+ ReverseProxy.version
71
+ ```
72
+
73
+ Feel free to open an issue!
62
74
 
63
75
  ## Contributing
64
76
 
@@ -73,6 +85,6 @@ Special thanks to our contributors!
73
85
 
74
86
  ## Copyright
75
87
 
76
- Copyright (c) 2016 James Hu. See LICENSE.txt for
88
+ Copyright (c) 2016 James Hu. See [LICENSE](LICENSE) for
77
89
  further details.
78
90
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.7.0
@@ -37,10 +37,11 @@ module ReverseProxy
37
37
 
38
38
  def request(env, options = {}, &block)
39
39
  options.reverse_merge!(
40
- headers: {},
41
- path: nil,
42
- username: nil,
43
- password: nil
40
+ headers: {},
41
+ path: nil,
42
+ username: nil,
43
+ password: nil,
44
+ verify_ssl: true
44
45
  )
45
46
 
46
47
  source_request = Rack::Request.new(env)
@@ -78,8 +79,12 @@ module ReverseProxy
78
79
  # within Varnish (503)
79
80
  target_request['Accept-Encoding'] = nil
80
81
 
82
+ http_options = {}
83
+ http_options[:use_ssl] = (uri.scheme == "https")
84
+ http_options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if options[:verify_ssl]
85
+
81
86
  # Make the request
82
- Net::HTTP.start(uri.hostname, uri.port, use_ssl: (uri.scheme == "https")) do |http|
87
+ Net::HTTP.start(uri.hostname, uri.port, http_options) do |http|
83
88
  target_response = http.request(target_request)
84
89
  end
85
90
 
@@ -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.6.1 ruby lib
5
+ # stub: rails-reverse-proxy 0.7.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "rails-reverse-proxy"
9
- s.version = "0.6.1"
9
+ s.version = "0.7.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["James Hu"]
14
- s.date = "2016-10-05"
14
+ s.date = "2016-10-12"
15
15
  s.description = "Reverse proxy for Ruby on Rails"
16
16
  s.email = "hello@james.hu"
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.6.1
4
+ version: 0.7.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: 2016-10-05 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails