-
Notifications
You must be signed in to change notification settings - Fork 1.4k
in_http improvements #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in_http improvements #473
Conversation
The 'add_remote_ip' configuration parameter allows the output filter to include the source IP address in a field called 'REMOTE_ADDR'. It can be activated into the source as follows: <source> type http port 9880 add_remote_ip </source> Signed-off-by: Eduardo Silva <[email protected]>
…t#426). This patch enable a partial and optional CORS support. For clients that want to talk directly to this source, it allows to set a white list of Cross Origin clients through the validation of the HTTP Origin header. Usage: <source> type http port 9880 cors_allow_origins http://example.com, http://www.treasuredata.com </source> The new configuration key 'cors_allow_origins', allows to specify a white list of domains, they must be separated by coma. For those request that do not pass the CORS filter, the service will respond with a '403 Forbidden' HTTP status code and close the connection. Note: the CORS validation is based on the HTTP request headers, for hence is NOT secure. Signed-off-by: Eduardo Silva <[email protected]>
lib/fluent/plugin/in_http.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have array type since v0.10.46 so using array is better than 'a,b,c' string style.
Signed-off-by: Eduardo Silva <[email protected]>
|
thanks for the feedback. I have updated the branch with the suggested changes:
|
This patch makes the cors_allow_origins configuration key to store a JSON array, it can be used as follows: <source> type http port 9880 cors_allow_origins ["http://example.com", "http://www.treasuredata.com"] </source> Signed-off-by: Eduardo Silva <[email protected]>
1aba01e to
a839c20
Compare
|
LGTM 👍 |
|
I just merged this PR. If there are some feedbacks from users, we will update the code. |
in_http improvements Conflicts: lib/fluent/plugin/in_http.rb
|
cherry-picked to v0.10 branch (27b25b2) |
the following patches add support for two new configuration directives: