pretty_proxy 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pretty_proxy.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f0b7cd40975e96c78486559c56a14332c80c480
|
4
|
+
data.tar.gz: 36e64c2a281cf96d487b4258a096204f4f1bc9da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd0cd6022492f5b31122b58b52f8f907674b8c55c37f5d38dbc510d19f59904bdcab62714b35884670a0047f54169bce43c4c24ab7fc31646fd434a29079c650
|
7
|
+
data.tar.gz: 164ea3a9431730971635076a2173799fa87e555f35f0f5fc2aeba73220e903154c4ac122da8b670c8cafdc7f7d7449938afdeb0300e8684211e13f780d46ab30
|
data/lib/pretty_proxy.rb
CHANGED
@@ -3,7 +3,6 @@ require 'nokogiri'
|
|
3
3
|
require 'rack'
|
4
4
|
require 'rack-proxy'
|
5
5
|
require 'addressable/uri'
|
6
|
-
require 'uri'
|
7
6
|
|
8
7
|
# The PrettyProxy class aggregate and validate the configuration of a
|
9
8
|
# proxy based in simple pretty url oriented rewriting rules. It's too
|
@@ -245,13 +244,13 @@ class PrettyProxy < Rack::Proxy
|
|
245
244
|
env = env.clone
|
246
245
|
url_requested_to_proxy = Rack::Request.new(env).url
|
247
246
|
# Using URI, and not Addressable::URI because the port value is incorrect in the last
|
248
|
-
unproxified_url = URI(unproxify_url(url_requested_to_proxy))
|
247
|
+
unproxified_url = Addressable::URI.parse(unproxify_url(url_requested_to_proxy))
|
249
248
|
|
250
249
|
if env['HTTP_HOST']
|
251
250
|
env['HTTP_HOST'] = unproxified_url.host
|
252
251
|
end
|
253
252
|
env['SERVER_NAME'] = unproxified_url.host
|
254
|
-
env['SERVER_PORT'] = unproxified_url.
|
253
|
+
env['SERVER_PORT'] = unproxified_url.inferred_port.to_s
|
255
254
|
|
256
255
|
if env['SCRIPT_NAME'].empty? && !env['PATH_INFO'].empty?
|
257
256
|
env['PATH_INFO'] = unproxified_url.path
|
@@ -423,9 +422,9 @@ class PrettyProxy < Rack::Proxy
|
|
423
422
|
module Utils
|
424
423
|
# TODO: check if isn't the case of change this for 'u1.site == u2.site'
|
425
424
|
def self.same_domain?(u1, u2)
|
426
|
-
u1.
|
427
|
-
u1.
|
428
|
-
u1.
|
425
|
+
u1.normalized_scheme == u2.normalized_scheme &&
|
426
|
+
u1.normalized_host == u2.normalized_host &&
|
427
|
+
u1.normalized_port == u2.normalized_port
|
429
428
|
end
|
430
429
|
|
431
430
|
def self.validate_proxy_path(proxy_path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|