logstash-input-http icon indicating copy to clipboard operation
logstash-input-http copied to clipboard

Adds response_body to configuration options

Open excalq opened this issue 3 years ago • 0 comments

Adds a new config option: response_body, which keeps the current (String) ok as the default. This is useful for being able to issue a JSON response to clients.

Additionally, the response_headers default Content-Type is now lowercased, as is expected by the Netty HTTP library, and by HTTP/2.x. HTTP/1.x is case-insensitive.

I've tested this via gradle build, vendor, bundle and loading the resulting gem into a local Docker-Compose stack, in which Postman shows the hot-reloaded change from ok to {"ok": true}. Setting response headers also appear in Postman.

Help Needed: I am unable to run bundle exec rspec without Java errors (java.lang.IllegalAccessError: class com.google.googlejavaformat.java.JavaInput ... jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0x5f32ab17), likely due to JRuby being compiled with OpenJDK 19? (Installed via Homebrew). The problem looks like it's in ../logstash/logstash-core.

Can someone assist by recommending JRuby and Java versions that are known to be working?

Otherwise, I assume the spec test changes in #120 will provide great coverage for this PR.

excalq avatar Jan 24 '23 00:01 excalq