logstash-filter-http 1.2.1 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d5469fab82031f6b39e205f18142291d9896c97cd4b650c5124ff0f661ca945
4
- data.tar.gz: 878169ea102e2c342fabed654cc8d265df31a7a935fbe8dd4260f79c2b393fce
3
+ metadata.gz: cf9e6e5719322e393443523446a54d9940048cd2dc540d4f71afedf7dd58b1dd
4
+ data.tar.gz: 72869368a417ccc28e522ab0ef47a3910d3bdb8565a9c215108a3cc3d8f088ca
5
5
  SHA512:
6
- metadata.gz: 6f0f5d51f50ec667de851cf7223d004062d3946c1bc0ee4b849edb3de26bc3da5246a168502c3a169023d646772835f79ebf990daf615085e4ce57a8ed5cc2db
7
- data.tar.gz: 25d1125226d4c5adbc0bb74bac0ba1d0e7aa02eba55d765e0a15c084638efea664bab10e618eeb80d85e36cc4e94140708c93b26fab6843e3c9a15d13947732a
6
+ metadata.gz: 2c76225e97cc973becbace99e5f2af1cbbebcdc73d264e735dc6064b5d7d1ecd88a51f0665bed3df2c6571d209c61ffa044be69f009762454713d367f96e653b
7
+ data.tar.gz: 2cffbf09fc61fd9a0fc7594e7f828497e9c8e098e056053c8791a2d9bb16533cedf2b31f3cf934f1bd5cc40e9d2574f007895a90ff469d962fb4a6d6f19eec52
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 1.4.1
2
+ - Fix: don't process response body for HEAD requests [#40](https://github.com/logstash-plugins/logstash-filter-http/pull/40)
3
+
4
+ ## 1.4.0
5
+ - Feat: added ssl_supported_protocols option [#38](https://github.com/logstash-plugins/logstash-filter-http/pull/38)
6
+
7
+ ## 1.3.0
8
+ - Feat: support ssl_verification_mode option [#37](https://github.com/logstash-plugins/logstash-filter-http/pull/37)
9
+
1
10
  ## 1.2.1
2
11
  - Fix: do not set content-type if provided by user [#36](https://github.com/logstash-plugins/logstash-filter-http/pull/36)
3
12
 
@@ -134,6 +134,7 @@ EOF
134
134
  def process_response(body, headers, event)
135
135
  content_type, _ = headers.fetch("content-type", "").split(";")
136
136
  event.set(@target_headers, headers)
137
+ return if @verb == 'head' # Since HEAD requests will not contain body, we need to set only header
137
138
  if content_type == "application/json"
138
139
  begin
139
140
  parsed = LogStash::Json.load(body)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-filter-http'
3
- s.version = '1.2.1'
3
+ s.version = '1.4.1'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'This filter requests data from a RESTful Web Service.'
6
6
  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 logstash-filter-http. This gem is not a stand-alone program'
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  # Gem dependencies
29
29
  s.add_runtime_dependency 'logstash-core-plugin-api', '>= 1.60', '<= 2.99'
30
30
  s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.2'
31
- s.add_runtime_dependency 'logstash-mixin-http_client', '>= 5.0.0', '< 9.0.0'
31
+ s.add_runtime_dependency "logstash-mixin-http_client", ">= 7.2.0", '< 9.0.0'
32
32
  s.add_runtime_dependency 'logstash-mixin-validator_support', '~> 1.0'
33
33
 
34
34
  s.add_development_dependency 'logstash-devutils'
@@ -191,7 +191,6 @@ describe LogStash::Filters::Http do
191
191
  before(:each) { subject.register }
192
192
  let(:response) { [200, {}, "Bom dia"] }
193
193
  let(:url) { "http://stringsize.com" }
194
- let(:config) { super().merge "body" => body }
195
194
 
196
195
  describe "format" do
197
196
  let(:config) { super().merge "body_format" => body_format, "body" => body }
@@ -277,6 +276,16 @@ describe LogStash::Filters::Http do
277
276
  subject.filter(event)
278
277
  end
279
278
  end
279
+ context "when the verb is HEAD" do
280
+ let(:config) { super().merge("verb" => "HEAD") }
281
+ before(:each) do
282
+ allow(subject).to receive(:request_http).and_return(response)
283
+ end
284
+ it "does not include the body" do
285
+ subject.filter(event)
286
+ expect(event).to_not include("body")
287
+ end
288
+ end
280
289
  end
281
290
  describe "verb" do
282
291
  let(:response) { [200, {}, "Bom dia"] }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-29 00:00:00.000000000 Z
11
+ date: 2022-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  requirements:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 5.0.0
52
+ version: 7.2.0
53
53
  - - "<"
54
54
  - !ruby/object:Gem::Version
55
55
  version: 9.0.0
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 5.0.0
63
+ version: 7.2.0
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: 9.0.0