simple-http 0.1.4 → 0.1.5

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: 3711a46073b07c99d04ff55ed6cd0c1cc44f68f4
4
- data.tar.gz: 79522eb93745b870aa0eb41ea28b917cbfdf7a53
3
+ metadata.gz: 629d4ae6ecbf63473054f8cdc95b88bdae1a5251
4
+ data.tar.gz: 782dab2622b3d481d9dd5eabc77231707a5b0abe
5
5
  SHA512:
6
- metadata.gz: 638367ce95b61893708d7bd7ccdca66b9e90fbc8aa450dbbf0b1a1c6abcaf2fe3e78630fd5312e816a464c516772cf98ccf8408c03dc5b0068033230533b4471
7
- data.tar.gz: 0713b7e593474e39825f84dab3d854460945d4cf4d2f3fec527c7bdc6c47248290f021eba8e8dc139ea32c19e446ef7a1e8c309ee0c10c2c39a8342ef7b60b06
6
+ metadata.gz: 6b6b5133cd3ad03c1f2bf29a96e8c21bfdfd5df97de3c57aaa3dc1da6da3e59dc964085f1e86cf8255ca4126aad3d5871f715f9061f47a36277a53634c0c1a2a
7
+ data.tar.gz: d6c270201e14f28b6edde03a28571a9bcc46aa792a0751ac07b61a5144331a9f5d07c4c6e548f3f9abc3aa9ee0c48abb2495c3dc38e5b24b81e9bc3525ca78ad
@@ -150,8 +150,14 @@ class Simple::HTTP
150
150
  if max_redirections <= 0
151
151
  raise TooManyRedirections.new(method, request, respons)
152
152
  end
153
-
154
- return http_(:GET, response["Location"], nil, {}, max_redirections - 1)
153
+
154
+ target_url = response["Location"]
155
+ unless target_url =~ /^(http|https):\/\//
156
+ base_url = "#{uri.scheme}://#{uri.host}"
157
+ File.join base_url, target_url
158
+ end
159
+
160
+ return http_(:GET, target_url, nil, {}, max_redirections - 1)
155
161
  end
156
162
 
157
163
  #
@@ -5,5 +5,5 @@
5
5
 
6
6
  module Simple; end
7
7
  class Simple::HTTP
8
- VERSION = "0.1.4"
8
+ VERSION = "0.1.5"
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2017-03-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Simple code for simple HTTP requests
14
14
  email: eno@radiospiel.org
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  version: '0'
48
48
  requirements: []
49
49
  rubyforge_project:
50
- rubygems_version: 2.4.6
50
+ rubygems_version: 2.5.1
51
51
  signing_key:
52
52
  specification_version: 4
53
53
  summary: Simple code for simple HTTP requests