logstash-filter-http 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1eab107931f9800b2f79a338dcc58a5f6bf0f18703738de822ba663c1d3e882c
4
- data.tar.gz: b59faea346ae0c7414b539d91d8d053254667cf01c700b1169b3eb6145d65768
3
+ metadata.gz: 81c8d1ec8c914081f8ce16a71a22be25e114afa967fb327c133503a5cca7263f
4
+ data.tar.gz: 37f64bd9d01e2361881fccf2d638b6471372fe1b69acd81e36efdfccb2e61916
5
5
  SHA512:
6
- metadata.gz: e760ced473f745bdf0d50cabf3803a2abbb1ddd2e9203fa20021899636c289bad1cbb09c6b56b0b1626dae01af2530f62200c343836f6ef447de39e621694cb5
7
- data.tar.gz: 4796a68ece2ffe8f977c7d985325eb30485457cac6e6d11e59dccf90c49fa6d107f9b3f3c5dddcb992b36297f13ed16c36405c953537f229c16b98f186acd6b6
6
+ metadata.gz: 42b529894dd5d0b34b398ed1522b6b1472ca0d934d8d52e932017b7f9dc9d6412d1ff17265bad21ba8bdd6ed0ea29d6a04627a476ebcdd375be1a2676a959d2f
7
+ data.tar.gz: b0111d7b61fe6f092526e919302e01ec73ab1e6c1c75d2329e8337ad67a14036195509e1357320f8228340cff0e85bba0b92da440f1ace5e6e52e49eba5baf3c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.5.1
2
+ - Don't process response when the body is empty. [#50](https://github.com/logstash-plugins/logstash-filter-http/pull/50)
3
+
1
4
  ## 1.5.0
2
5
  - Added standardized SSL settings and deprecates their non-standard counterparts. Deprecated settings will continue to work, and will provide pipeline maintainers with guidance toward using their standardized counterparts [#49](https://github.com/logstash-plugins/logstash-filter-http/pull/49)
3
6
  - Added new `ssl_truststore_path`, `ssl_truststore_password`, and `ssl_truststore_type` settings for configuring SSL-trust using a PKCS-12 or JKS trust store, deprecating their `truststore`, `truststore_password`, and `truststore_type` counterparts.
@@ -136,6 +136,8 @@ EOF
136
136
  event.set(@target_headers, headers)
137
137
  return if @verb == 'head' # Since HEAD requests will not contain body, we need to set only header
138
138
 
139
+ return if body.nil? #Return on empty bodys (e.g. 204 response)
140
+
139
141
  if headers_has_json_content_type?(headers)
140
142
  begin
141
143
  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.5.0'
3
+ s.version = '1.5.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'
@@ -61,6 +61,14 @@ describe LogStash::Filters::Http do
61
61
  end
62
62
  end
63
63
 
64
+ context "when there is no body" do
65
+ let(:response) { [204, {}, nil] }
66
+
67
+ it "doesn't write a body to the event" do
68
+ expect(event.get('[gw-response]')).to be_nil
69
+ end
70
+ end
71
+
64
72
  context 'with body target' do
65
73
 
66
74
  let(:config) { super().merge "target_body" => '[rest]' }
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.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-01 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement