Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* allow uri to be nil ('http://nil-uri-given/' is used instead for t…

…esting purpose). closes #192.
  • Loading branch information...
commit 562402a598af99a7cfccdeb8fc51ad85b748f0d8 1 parent 01da931
nahi authored
Showing with 6 additions and 2 deletions.
  1. +2 −1  lib/httpclient/http.rb
  2. +3 −0  test/sslsvr.rb
  3. +1 −1  test/test_ssl.rb
View
3  lib/httpclient/http.rb
@@ -159,10 +159,11 @@ def init_connect_request(uri, hostport)
@http_version = 1.0
end
+ NIL_URI = URI.parse('http://nil-uri-given/')
def init_request(method, uri, query = nil)
@is_request = true
@request_method = method
- @request_uri = uri
+ @request_uri = uri || NIL_URI
@request_query = create_query_uri(@request_uri, query)
@request_via_proxy = false
end
View
3  test/sslsvr.rb
@@ -39,6 +39,9 @@ def do_hello(req, res)
:SSLClientCA => cert('ca.cert'),
:SSLCertName => nil
)
+trap(:INT) do
+ server.shutdown
+end
[:hello].each do |sym|
server.mount(
"/#{sym}",
View
2  test/test_ssl.rb
@@ -182,7 +182,7 @@ def setup_client
def teardown_server
if @serverpid
- Process.kill('KILL', @serverpid) rescue nil
+ Process.kill('INT', @serverpid)
Process.waitpid(@serverpid) rescue nil
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.