From d11e57145093eaa24ddeaeb45e5595c22810db34 Mon Sep 17 00:00:00 2001 From: Jason Stoltzfus Date: Thu, 18 Oct 2018 14:07:52 -0400 Subject: [PATCH 1/2] Passing username and password through on proxy --- lib/swiftype/request.rb | 2 +- spec/client_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/swiftype/request.rb b/lib/swiftype/request.rb index 60c498d..0297d1f 100644 --- a/lib/swiftype/request.rb +++ b/lib/swiftype/request.rb @@ -60,7 +60,7 @@ def request(method, path, params={}) if proxy proxy_parts = URI.parse(proxy) - http = Net::HTTP.new(uri.host, uri.port, proxy_parts.host, proxy_parts.port) + http = Net::HTTP.new(uri.host, uri.port, proxy_parts.host, proxy_parts.port, proxy_parts.user, proxy_parts.password) else http = Net::HTTP.new(uri.host, uri.port) end diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 52b6261..9f151d0 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -103,10 +103,10 @@ end context 'with proxy specified' do - let(:options) { { :proxy => 'http://localhost:8888' } } + let(:options) { { :proxy => 'http://username:password@localhost:8888' } } it 'will set proxy' do - expect(options_client.proxy).to eq('http://localhost:8888') + expect(options_client.proxy).to eq('http://username:password@localhost:8888') end # There doesn't seem to be an elgant way to test that a request actually uses a proxy, so the best From 1a0f7b161a2f52077be3215fee3463f608e56f02 Mon Sep 17 00:00:00 2001 From: Jason Stoltzfus Date: Thu, 18 Oct 2018 14:08:45 -0400 Subject: [PATCH 2/2] Release 1.3.1 --- README.md | 6 +++--- lib/swiftype/version.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab9009b..d648093 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To install the gem, execute: gem install swiftype -Or place `gem 'swiftype', '~> 1.2.0` in your `Gemfile` and run `bundle install`. +Or place `gem 'swiftype', '~> 1.3.1` in your `Gemfile` and run `bundle install`. ## Usage @@ -372,8 +372,8 @@ swiftype-rb 1.0 has been rewritten to be simpler and easier to use. However, it To upgrade from the old version of swiftype-rb: -* If you previously used the `Swiftype` client, migrate your API calls to the `Swiftype::Client` format. -* If you previously used the `Swiftype::Easy` client, change `Swiftype::Easy` to `Swiftype::Client`. Almost all method calls should be the same (there are a few minor changes). +- If you previously used the `Swiftype` client, migrate your API calls to the `Swiftype::Client` format. +- If you previously used the `Swiftype::Easy` client, change `Swiftype::Easy` to `Swiftype::Client`. Almost all method calls should be the same (there are a few minor changes). Additionally, the result object returned by search methods (for example, the old Swiftype gem's `Engine#search` or `Swiftype::Easy#search` methods) returns results in a different way. Instead of being an array of `Swiftype::Document` objects, it will be an array of Hashes. diff --git a/lib/swiftype/version.rb b/lib/swiftype/version.rb index 02d3409..a937f32 100644 --- a/lib/swiftype/version.rb +++ b/lib/swiftype/version.rb @@ -1,3 +1,3 @@ module Swiftype - VERSION = "1.3.0" + VERSION = "1.3.1" end