deelay 0.5.1 → 0.5.2

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
  SHA1:
3
- metadata.gz: 94c3007bb46c2aa6bb848c365c61a25075ff476a
4
- data.tar.gz: 302b9ffe7ea1899a5d9832f573d483e1d7a30c39
3
+ metadata.gz: 843b237847a987ba559381e4bfdbf70706f0b8b3
4
+ data.tar.gz: 2164a874e8789e7d3dd61cd35ae0e50e48ed2dd7
5
5
  SHA512:
6
- metadata.gz: d81f185212f92908dc138c8b00e52403d9903042100852e933bfbac9db73910f0c9b20f040bff99cb4b84999c8172c96f0f229c2a47031b8adaabc53ab672e82
7
- data.tar.gz: 1e1bde96a1fbadf45195b2315a4a22bca5b079fd1d93e4904af0ad636fb6ea2143f0a45c56a5772f90aace460ecb6879f0b58811ca937803660f7f4c83ead0b9
6
+ metadata.gz: 6e2c7bb4564b9ed4481413b6db082e6449ebb9da86ab3acb153c91ebaedc48dd44749712cddb8aa1908c4c95a1cbbdea4a3645ae689fb14ba0a1a1d53df3ce48
7
+ data.tar.gz: 80a598cb4deadb1f66d0a3409e7d61ebcdadff7b29e191ff4b11194603ad3b189f028d4624b961eecb382b1d5b8cb90c4381b118ddd37419bc834d25c00242c0
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ coverage/
@@ -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.
@@ -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
- url = escaped_url.sub(/^http:\//, "http://")
17
- url = "http://" + url if url !~ /^http:\/\//
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
@@ -1,3 +1,3 @@
1
1
  module Deelay
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -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.1
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: 2014-06-02 00:00:00.000000000 Z
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.2.2
55
+ rubygems_version: 2.4.5
55
56
  signing_key:
56
57
  specification_version: 4
57
58
  summary: Delay proxy