Adds response_body to configuration options #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
defaultContent-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 fromok
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.