From 7a4435ff68bc823ba9891b796a71e180ed8483d3 Mon Sep 17 00:00:00 2001 From: Megan Rantz <./dev infra> Date: Mon, 20 Oct 2025 09:09:17 -0400 Subject: [PATCH 1/3] Add support for setting default headers on http-ots --- lib/ews/connection.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ews/connection.rb b/lib/ews/connection.rb index edc4ab55..1fc07882 100644 --- a/lib/ews/connection.rb +++ b/lib/ews/connection.rb @@ -24,7 +24,7 @@ class Viewpoint::EWS::Connection attr_reader :endpoint # @param [String] endpoint the URL of the web service. # @example https:///ews/Exchange.asmx - # @param [Hash] opts Misc config options (mostly for developement) + # @param [Hash] opts Misc config options (mostly for development) # @option opts [Fixnum] :ssl_verify_mode # @option opts [Fixnum] :receive_timeout override the default receive timeout # seconds @@ -34,7 +34,9 @@ class Viewpoint::EWS::Connection # @option opts [String] :user_agent the http user agent to use in all requests def initialize(endpoint, opts = {}) @log = Logging.logger[self.class.name.to_s.to_sym] - if opts[:user_agent] + if opts[:default_header] + @httpcli = HTTPClient.new(default_header: opts[:default_header]) + elsif opts[:user_agent] @httpcli = HTTPClient.new(agent_name: opts[:user_agent]) else @httpcli = HTTPClient.new From 374f04af807c3e1a8230ff257e87175dfeaaf571 Mon Sep 17 00:00:00 2001 From: Megan Rantz <./dev infra> Date: Mon, 20 Oct 2025 09:27:03 -0400 Subject: [PATCH 2/3] Update READ.me links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d4d28da..6f09dbeb 100644 --- a/README.md +++ b/README.md @@ -196,8 +196,8 @@ end If you see something that could be done better or would like to help out in the development of this code please feel free to clone the 'git' repository and send me patches: -`git clone git://github.com/zenchild/Viewpoint.git` +`git clone https://github.com/WinRb/Viewpoint.git` or add an issue on GitHub: -http://github.com/zenchild/Viewpoint/issues +https://github.com/WinRb/Viewpoint/issues Cheers! From 8e1b00da388a5d79469c5ce87d699f8ac896d8d0 Mon Sep 17 00:00:00 2001 From: Megan Rantz <./dev infra> Date: Tue, 28 Oct 2025 09:09:58 -0400 Subject: [PATCH 3/3] commit suggestion, thanks --- lib/ews/connection.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/ews/connection.rb b/lib/ews/connection.rb index 1fc07882..441413bc 100644 --- a/lib/ews/connection.rb +++ b/lib/ews/connection.rb @@ -22,6 +22,8 @@ class Viewpoint::EWS::Connection include Viewpoint::EWS attr_reader :endpoint + @@supported_httpclient_opts = %i[agent_name default_header] + # @param [String] endpoint the URL of the web service. # @example https:///ews/Exchange.asmx # @param [Hash] opts Misc config options (mostly for development) @@ -34,13 +36,9 @@ class Viewpoint::EWS::Connection # @option opts [String] :user_agent the http user agent to use in all requests def initialize(endpoint, opts = {}) @log = Logging.logger[self.class.name.to_s.to_sym] - if opts[:default_header] - @httpcli = HTTPClient.new(default_header: opts[:default_header]) - elsif opts[:user_agent] - @httpcli = HTTPClient.new(agent_name: opts[:user_agent]) - else - @httpcli = HTTPClient.new - end + + httpclient_opts = opts.slice(*@@supported_httpclient_opts) + @httpcli = HTTPClient.new(**httpclient_opts) if opts[:trust_ca] @httpcli.ssl_config.clear_cert_store