Author: bryanduxbury
Date: Tue Mar 2 18:34:00 2010
New Revision: 918137
URL: http://svn.apache.org/viewvc?rev=918137&view=rev
Log:
THRIFT-720. rb: HTTPClientTransport ignores url parameters
This patch causes the url parameters to be sent as expected. Patch by Tony
Kamenick.
Modified:
incubator/thrift/trunk/lib/rb/lib/thrift/transport/http_client_transport.rb
incubator/thrift/trunk/lib/rb/spec/http_client_spec.rb
Modified:
incubator/thrift/trunk/lib/rb/lib/thrift/transport/http_client_transport.rb
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/lib/thrift/transport/http_client_transport.rb?rev=918137&r1=918136&r2=918137&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/lib/thrift/transport/http_client_transport.rb
(original)
+++ incubator/thrift/trunk/lib/rb/lib/thrift/transport/http_client_transport.rb
Tue Mar 2 18:34:00 2010
@@ -37,7 +37,7 @@
http = Net::HTTP.new @url.host, @url.port
http.use_ssl = @url.scheme == "https"
headers = { 'Content-Type' => 'application/x-thrift' }
- resp, data = http.post(@url.path, @outbuf, headers)
+ resp, data = http.post(@url.request_uri, @outbuf, headers)
@inbuf = StringIO.new data
@outbuf = ""
end
Modified: incubator/thrift/trunk/lib/rb/spec/http_client_spec.rb
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/http_client_spec.rb?rev=918137&r1=918136&r2=918137&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/http_client_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/http_client_spec.rb Tue Mar 2 18:34:00
2010
@@ -24,7 +24,7 @@
describe HTTPClientTransport do
before(:each) do
- @client = HTTPClientTransport.new("http://my.domain.com/path/to/service")
+ @client =
HTTPClientTransport.new("http://my.domain.com/path/to/service?param=value")
end
it "should always be open" do
@@ -39,7 +39,7 @@
Net::HTTP.should_receive(:new).with("my.domain.com", 80).and_return do
mock("Net::HTTP").tee do |http|
http.should_receive(:use_ssl=).with(false)
- http.should_receive(:post).with("/path/to/service", "a test frame",
{"Content-Type"=>"application/x-thrift"}).and_return([nil, "data"])
+ http.should_receive(:post).with("/path/to/service?param=value", "a
test frame", {"Content-Type"=>"application/x-thrift"}).and_return([nil, "data"])
end
end
@client.flush