diff --git a/CHANGELOG.md b/CHANGELOG.md index f96b618..9c99767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 7.1.0 + - Add: "lax_redirects" setting to redirect POST/DELETE + ## 7.0.0 - Removed obsolete ssl_certificate_verify option diff --git a/lib/logstash/plugin_mixins/http_client.rb b/lib/logstash/plugin_mixins/http_client.rb index bbe6d49..b4236f0 100644 --- a/lib/logstash/plugin_mixins/http_client.rb +++ b/lib/logstash/plugin_mixins/http_client.rb @@ -27,6 +27,9 @@ def setup_http_client_config # Should redirects be followed? Defaults to `true` config :follow_redirects, :validate => :boolean, :default => true + # Allow POST and DELETE to also be redirected + config :lax_redirects, :validate => :boolean, :default => false + # Max number of concurrent connections. Defaults to `50` config :pool_max, :validate => :number, :default => 50 @@ -175,7 +178,11 @@ def client_config private def make_client - Manticore::Client.new(client_config) + Manticore::Client.new(client_config) do |builder, _| + if @lax_redirects + builder.set_redirect_strategy org.apache.http.impl.client.LaxRedirectStrategy.new + end + end end public diff --git a/logstash-mixin-http_client.gemspec b/logstash-mixin-http_client.gemspec index 21b1e61..19f44d5 100644 --- a/logstash-mixin-http_client.gemspec +++ b/logstash-mixin-http_client.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'logstash-mixin-http_client' - s.version = '7.0.0' + s.version = '7.1.0' s.licenses = ['Apache License (2.0)'] s.summary = "AWS mixins to provide a unified interface for Amazon Webservice" s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"