Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
4f1bbc7
)
rb: Support SSL and correct Content-Type in HTTPClient [THRIFT-156]
author
Kevin Clark
<kclark@apache.org>
Wed, 15 Oct 2008 19:06:18 +0000
(19:06 +0000)
committer
Kevin Clark
<kclark@apache.org>
Wed, 15 Oct 2008 19:06:18 +0000
(19:06 +0000)
Author: Dave Engberg
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@704994
13f79535
-47bb-0310-9956-
ffa450edef68
lib/rb/lib/thrift/transport/httpclient.rb
patch
|
blob
|
history
diff --git
a/lib/rb/lib/thrift/transport/httpclient.rb
b/lib/rb/lib/thrift/transport/httpclient.rb
index
2c4adfc
..
cdfd26c
100644
(file)
--- a/
lib/rb/lib/thrift/transport/httpclient.rb
+++ b/
lib/rb/lib/thrift/transport/httpclient.rb
@@
-1,6
+1,7
@@
require 'thrift/transport'
require 'net/http'
+require 'net/https'
require 'uri'
require 'stringio'
@@
-17,7
+18,9
@@
module Thrift
def write(buf); @outbuf << buf end
def flush
http = Net::HTTP.new @url.host, @url.port
- resp, data = http.post(@url.path, @outbuf)
+ http.use_ssl = @url.scheme == "https"
+ headers = { 'Content-Type' => 'application/x-thrift' }
+ resp, data = http.post(@url.path, @outbuf, headers)
@inbuf = StringIO.new data
@outbuf = ""
end