logstash-plugins / logstash-filter-http

HTTP Filter Plugin for Logstash
Apache License 2.0
12 stars 29 forks source link

skip processing for responses that do not contain a response body #43

Closed asymmetricia closed 8 months ago

asymmetricia commented 1 year ago

At least, HTTP 204 explicitly does not contain a response body. In this case, body will be NilClass, and when we call body.strip it'll raise an exception:

:error=>"(NoMethodError) undefined method `strip' for nil:NilClass", :exception=>Java::OrgJrubyExceptions::NoMethodError, :backtrace=>["usr.share.logstash.vendor.bundle.jruby.$2_dot_6_dot_0.gems.logstash_minus_filter_minus_http_minus_1_dot_4_dot_1.lib.logstash.filters.http.process_response(/usr/share/logstash/vendor/bundle/jruby/2.6.0/gems/logstash-filter-http-1.4.1/lib/logstash/filters/http.rb:151)"

Release notes

What does this PR do?

Why is it important/What is the impact to the user?

Checklist

Author's Checklist

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

cla-checker-service[bot] commented 1 year ago

❌ Author of the following commits did not sign a Contributor Agreement: a36e3c1d8ac695f0776a025b8fd77d927bd908eb

Please, read and sign the above mentioned agreement if you want to contribute to this project

pdbogen commented 1 year ago

Apologies, closing this for now, as it's going to take some time to arrange a company CLA.

pdbogen commented 1 year ago

(Though rather, I guess I'll need to request it be closed, since I can't close it myself.)

jsvd commented 8 months ago

fixed in #50, thank you for the contribution :)