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 +4 -4
- data/lib/tilia/http/sapi.rb +6 -4
- data/lib/tilia/http/version.rb +1 -1
- data/test/http/request_test.rb +2 -2
- data/test/http/sapi_test.rb +4 -4
- 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: 25f3b7a2f9d24ea9e2e81c8b73a3bf5e14ddc9df
|
4
|
+
data.tar.gz: f08a678d7758867c3a8df7d7eb97bd8cff18780b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 879360ae9c1b58f6d9f495dc6acb59207d09da1d56a1527ab57028f69b0d130706bdf2d87bd5a0609031abe6aa75d4be32b33e91f88b167d4bcc515553615740
|
7
|
+
data.tar.gz: c74e3a175cb02424462172d788e34d3e06d483ee4169bf63566efebea05d8b71ce7414efcd927547d8ec52b0de2e2aa5ff8d17a32e1444872b981f8058b0f216
|
data/lib/tilia/http/sapi.rb
CHANGED
@@ -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 =
|
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 '
|
83
|
-
url
|
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 &&
|
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
|
data/lib/tilia/http/version.rb
CHANGED
data/test/http/request_test.rb
CHANGED
@@ -38,7 +38,7 @@ module Tilia
|
|
38
38
|
def test_get_absolute_url
|
39
39
|
s = {
|
40
40
|
'HTTP_HOST' => 'sabredav.org',
|
41
|
-
'
|
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
|
-
'
|
50
|
+
'PATH_INFO' => '/foo',
|
51
51
|
'HTTPS' => 'on'
|
52
52
|
}
|
53
53
|
|
data/test/http/sapi_test.rb
CHANGED
@@ -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
|
-
'
|
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
|
-
'
|
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
|
-
'
|
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
|
-
'
|
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.
|
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-
|
11
|
+
date: 2016-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|