Fixes the crash when plugin receives the Content-Type header as an Array. This change introduces a resolution of content type which supports: array, string and empty string.
Why is it important/What is the impact to the user?
Some applications (example apigateway-openlogging-elk) is using a server which responses list of Content-Type media types.
Checklist
[x] My code follows the style guidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] I have made corresponding change to the default configuration files (and/or docker env variables)
[x] I have added tests that prove my fix is effective or that my feature works
## Related issues
- Closes #45
## Use cases
<!-- Recommended
Explain here the different behaviors that this PR introduces or modifies in this project, user roles, environment configuration, etc.
If you are familiar with Gherkin test scenarios, we recommend its usage: https://cucumber.io/docs/gherkin/reference/
-->
## Screenshots
<!-- Optional
Add here screenshots about how the project will be changed after the PR is applied. They could be related to web pages, terminal, etc, or any other image you consider important to be shared with the team.
-->
## Logs
<!-- Recommended
Paste here output logs discovered while creating this PR, such as stack traces or integration logs, or any other output you consider important to be shared with the team.
-->
Release notes
[rn:skip]
What does this PR do?
Fixes the crash when plugin receives the
Content-Type
header as anArray
. This change introduces a resolution of content type which supports:array
,string
and emptystring
.Why is it important/What is the impact to the user?
Some applications (example apigateway-openlogging-elk) is using a server which responses list of
Content-Type
media types.Checklist
Author's Checklist
How to test this PR locally
http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': ['text/plain', 'logstash/custom-type']} ); response.end('Hello World\n'); }).listen(8081);
console.log('Server running at http://127.0.0.1:8081/');