From 3e60fa6a54ecdd4b30df74e35ff64dbfd81a549c Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Tue, 2 Mar 2010 18:34:00 +0000 Subject: [PATCH] THRIFT-720. rb: HTTPClientTransport ignores url parameters This patch causes the url parameters to be sent as expected. Patch by Tony Kamenick. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@918137 13f79535-47bb-0310-9956-ffa450edef68 --- lib/rb/lib/thrift/transport/http_client_transport.rb | 2 +- lib/rb/spec/http_client_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rb/lib/thrift/transport/http_client_transport.rb b/lib/rb/lib/thrift/transport/http_client_transport.rb index a190a983..e62a51c1 100644 --- a/lib/rb/lib/thrift/transport/http_client_transport.rb +++ b/lib/rb/lib/thrift/transport/http_client_transport.rb @@ -37,7 +37,7 @@ module Thrift 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 diff --git a/lib/rb/spec/http_client_spec.rb b/lib/rb/spec/http_client_spec.rb index 94526deb..c5a95343 100644 --- a/lib/rb/spec/http_client_spec.rb +++ b/lib/rb/spec/http_client_spec.rb @@ -24,7 +24,7 @@ class ThriftHTTPClientTransportSpec < Spec::ExampleGroup 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 @@ class ThriftHTTPClientTransportSpec < Spec::ExampleGroup 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 -- 2.17.1