logstash-filter-http 1.4.0 → 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: 9cc14c2d1874c8df2c795535e90ee6b7e85070d601039ab0a8f5c91da874af16
4
- data.tar.gz: 21c3aa078560f4900fb8db35eca35abb60b71798a224164f2a41cd4682e2f755
3
+ metadata.gz: cf9e6e5719322e393443523446a54d9940048cd2dc540d4f71afedf7dd58b1dd
4
+ data.tar.gz: 72869368a417ccc28e522ab0ef47a3910d3bdb8565a9c215108a3cc3d8f088ca
5
5
  SHA512:
6
- metadata.gz: aba589b66860997ba29e3edaa5564c04d897ed9502fc46b263a356ae80a7c768aa1570873ced5865aa7c66523e1aa04054ef604d61e68e4c3644f548456d82a1
7
- data.tar.gz: 8974fa26e8127e6a7a880d44c8df7be1ac4ec4435dc38a6912f589f1d1f7bc4eae2154f8cd2fdb3307a5a67896df2fd95e692460d182f65f5fb69cc12f2b58e1
6
+ metadata.gz: 2c76225e97cc973becbace99e5f2af1cbbebcdc73d264e735dc6064b5d7d1ecd88a51f0665bed3df2c6571d209c61ffa044be69f009762454713d367f96e653b
7
+ data.tar.gz: 2cffbf09fc61fd9a0fc7594e7f828497e9c8e098e056053c8791a2d9bb16533cedf2b31f3cf934f1bd5cc40e9d2574f007895a90ff469d962fb4a6d6f19eec52
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
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
+
1
4
  ## 1.4.0
2
5
  - Feat: added ssl_supported_protocols option [#38](https://github.com/logstash-plugins/logstash-filter-http/pull/38)
3
6
 
@@ -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.4.0'
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'
@@ -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.4.0
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: 2022-03-28 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