Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

http_server: add custom response headers #20395

Open
faust93 opened this issue Apr 29, 2024 · 0 comments
Open

http_server: add custom response headers #20395

faust93 opened this issue Apr 29, 2024 · 0 comments
Labels
source: http_server Anything `http_server` source related type: feature A value-adding code addition that introduce new functionality.

Comments

@faust93
Copy link

faust93 commented Apr 29, 2024

A note for the community

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

I'm running multiple Vector instances behind AWS ALB to consume client data using an http_server listener. According to our security policy, the response must have CORS headers (Access-Control-Allow-Origin, etc.) and a few other custom ones for the client side to work. Since, as far as I know, neither ALB nor Vector have this functionality (to provide custom headers in the response), I have to use an Nginx proxy in between to provide these headers, which is an additional moving part that I wanted to get rid of.

Attempted Solutions

Nginx reverse proxy in front of Vector's http_server sink

Proposal

Logstash has 'response_headers', would be nice to have similar functionality in Vector

input {
    http {
        port => 3000
        response_headers => {
            "Content-Type" => "text/plain"
            "Access-Control-Allow-Headers" => "User-Agent,Origin,Content-Type,Accept,Accept-Encoding,Accept-Language,Content-Type,Cookie"
            "Access-Control-Allow-Methods" => "GET,PUT,POST,OPTIONS"
            "Access-Control-Allow-Origin" => "xxxx"
        }
    }
}

References

No response

Version

No response

@faust93 faust93 added the type: feature A value-adding code addition that introduce new functionality. label Apr 29, 2024
@jszwedko jszwedko added the source: http_server Anything `http_server` source related label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: http_server Anything `http_server` source related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants