deelay 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/LICENSE.md +20 -0
- data/lib/deelay/utils.rb +3 -2
- data/lib/deelay/version.rb +1 -1
- data/test/test_deelay_app.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 843b237847a987ba559381e4bfdbf70706f0b8b3
|
4
|
+
data.tar.gz: 2164a874e8789e7d3dd61cd35ae0e50e48ed2dd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e2c7bb4564b9ed4481413b6db082e6449ebb9da86ab3acb153c91ebaedc48dd44749712cddb8aa1908c4c95a1cbbdea4a3645ae689fb14ba0a1a1d53df3ce48
|
7
|
+
data.tar.gz: 80a598cb4deadb1f66d0a3409e7d61ebcdadff7b29e191ff4b11194603ad3b189f028d4624b961eecb382b1d5b8cb90c4381b118ddd37419bc834d25c00242c0
|
data/.gitignore
CHANGED
data/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2015 Grzegorz Biesiadecki
|
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.
|
data/lib/deelay/utils.rb
CHANGED
@@ -13,8 +13,9 @@ module Deelay
|
|
13
13
|
raise ArgumentError, "Missing URL" if splat.empty?
|
14
14
|
|
15
15
|
escaped_url = ::URI.unescape(splat)
|
16
|
-
|
17
|
-
url = "
|
16
|
+
protocol = (escaped_url =~ /^https:/) ? 'https' : 'http'
|
17
|
+
url = escaped_url.sub(/^(http|https):\//, "#{protocol}://")
|
18
|
+
url = "#{protocol}://" + url if url !~ /^#{protocol}:\/\//
|
18
19
|
url << "?" + query_string if !query_string.empty?
|
19
20
|
return url
|
20
21
|
end
|
data/lib/deelay/version.rb
CHANGED
data/test/test_deelay_app.rb
CHANGED
@@ -36,6 +36,12 @@ class TestDeelayApp < MiniTest::Unit::TestCase
|
|
36
36
|
assert_equal 302, last_response.status
|
37
37
|
end
|
38
38
|
|
39
|
+
def test_redirect_url_with_https
|
40
|
+
get "/10/https://testurl.com/path"
|
41
|
+
em_async_continue
|
42
|
+
assert_equal "https://testurl.com/path", last_response.location
|
43
|
+
assert_equal 302, last_response.status
|
44
|
+
end
|
39
45
|
|
40
46
|
def test_redirect_url_with_scheme
|
41
47
|
get "/10/http://testurl.com/path"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deelay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Biesiadecki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Delay proxy for http resources
|
14
14
|
email:
|
@@ -21,6 +21,7 @@ files:
|
|
21
21
|
- ".gitignore"
|
22
22
|
- ".travis.yml"
|
23
23
|
- Gemfile
|
24
|
+
- LICENSE.md
|
24
25
|
- README.md
|
25
26
|
- Rakefile
|
26
27
|
- bin/deelay
|
@@ -51,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
52
|
version: '0'
|
52
53
|
requirements: []
|
53
54
|
rubyforge_project: deelay
|
54
|
-
rubygems_version: 2.
|
55
|
+
rubygems_version: 2.4.5
|
55
56
|
signing_key:
|
56
57
|
specification_version: 4
|
57
58
|
summary: Delay proxy
|