tilia-http 4.1.0.5 → 4.1.0.6

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: c431ff418e1a762240f228f4377aa5e5bcd72cde
4
- data.tar.gz: 70a61b39407f8c123855c72d70b9f4db5c21844e
3
+ metadata.gz: 25f3b7a2f9d24ea9e2e81c8b73a3bf5e14ddc9df
4
+ data.tar.gz: f08a678d7758867c3a8df7d7eb97bd8cff18780b
5
5
  SHA512:
6
- metadata.gz: 4014e54c6b40c0849ba916eac8dde2f7a59553dd72d8932eaffd6d2373bf57bb94ce22a04bfca9ed6042f647f5d8e6b8dd6b26b8281fd910325e27dcbb44357d
7
- data.tar.gz: 820e94c7bec2806b39d015ef8a396455e13a1431d2dd2ee0675ee6365b1f0af527662fa19b0ecef2175012548df5d9297f12dcac13784b1ab502716220aa84c7
6
+ metadata.gz: 879360ae9c1b58f6d9f495dc6acb59207d09da1d56a1527ab57028f69b0d130706bdf2d87bd5a0609031abe6aa75d4be32b33e91f88b167d4bcc515553615740
7
+ data.tar.gz: c74e3a175cb02424462172d788e34d3e06d483ee4169bf63566efebea05d8b71ce7414efcd927547d8ec52b0de2e2aa5ff8d17a32e1444872b981f8058b0f216
@@ -67,7 +67,7 @@ module Tilia
67
67
  def self.create_from_server_array(server_array)
68
68
  headers = {}
69
69
  method = nil
70
- url = nil
70
+ url = ''
71
71
  http_version = '1.1'
72
72
 
73
73
  protocol = 'http'
@@ -79,8 +79,10 @@ module Tilia
79
79
  http_version = '1.0' if value == 'HTTP/1.0'
80
80
  when 'REQUEST_METHOD'
81
81
  method = value
82
- when 'REQUEST_PATH'
83
- url = value
82
+ when 'PATH_INFO'
83
+ url += value
84
+ when 'SCRIPT_NAME'
85
+ url = value + url
84
86
 
85
87
  # These sometimes should up without a HTTP_ prefix
86
88
  when 'CONTENT_TYPE'
@@ -131,7 +133,7 @@ module Tilia
131
133
  end
132
134
 
133
135
  # RUBY: fake php ...
134
- url = "#{url}?#{server_array['QUERY_STRING']}" if url && !server_array['QUERY_STRING'].blank?
136
+ url = "#{url}?#{server_array['QUERY_STRING']}" if url && server_array['QUERY_STRING'].present?
135
137
 
136
138
  r = Tilia::Http::Request.new(method, url, headers)
137
139
  r.http_version = http_version
@@ -3,7 +3,7 @@ module Tilia
3
3
  # This class contains the version number for the HTTP package
4
4
  class Version
5
5
  # Full version number
6
- VERSION = '4.1.0.5'
6
+ VERSION = '4.1.0.6'
7
7
  end
8
8
  end
9
9
  end
@@ -38,7 +38,7 @@ module Tilia
38
38
  def test_get_absolute_url
39
39
  s = {
40
40
  'HTTP_HOST' => 'sabredav.org',
41
- 'REQUEST_PATH' => '/foo'
41
+ 'PATH_INFO' => '/foo'
42
42
  }
43
43
 
44
44
  r = Sapi.create_from_server_array(s)
@@ -47,7 +47,7 @@ module Tilia
47
47
 
48
48
  s = {
49
49
  'HTTP_HOST' => 'sabredav.org',
50
- 'REQUEST_PATH' => '/foo',
50
+ 'PATH_INFO' => '/foo',
51
51
  'HTTPS' => 'on'
52
52
  }
53
53
 
@@ -8,7 +8,7 @@ module Tilia
8
8
  class SapiTest < Minitest::Test
9
9
  def test_construct_from_server_array
10
10
  request = Sapi.create_from_server_array(
11
- 'REQUEST_PATH' => '/foo',
11
+ 'PATH_INFO' => '/foo',
12
12
  'REQUEST_METHOD' => 'GET',
13
13
  'HTTP_USER_AGENT' => 'Evert',
14
14
  'CONTENT_TYPE' => 'text/xml',
@@ -35,7 +35,7 @@ module Tilia
35
35
 
36
36
  def test_construct_php_auth
37
37
  request = Sapi.create_from_server_array(
38
- 'REQUEST_PATH' => '/foo',
38
+ 'PATH_INFO' => '/foo',
39
39
  'REQUEST_METHOD' => 'GET',
40
40
  'PHP_AUTH_USER' => 'user',
41
41
  'PHP_AUTH_PW' => 'pass'
@@ -53,7 +53,7 @@ module Tilia
53
53
 
54
54
  def test_construct_php_auth_digest
55
55
  request = Sapi.create_from_server_array(
56
- 'REQUEST_PATH' => '/foo',
56
+ 'PATH_INFO' => '/foo',
57
57
  'REQUEST_METHOD' => 'GET',
58
58
  'PHP_AUTH_DIGEST' => 'blabla'
59
59
  )
@@ -70,7 +70,7 @@ module Tilia
70
70
 
71
71
  def test_construct_redirect_auth
72
72
  request = Sapi.create_from_server_array(
73
- 'REQUEST_PATH' => '/foo',
73
+ 'PATH_INFO' => '/foo',
74
74
  'REQUEST_METHOD' => 'GET',
75
75
  'REDIRECT_HTTP_AUTHORIZATION' => 'Basic bla'
76
76
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tilia-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0.5
4
+ version: 4.1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Sack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport