Add caddy as reverse proxy for collector to modify headers
What does this MR do and why?
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/435209
Adds a reverse proxy to the collector. This allows the addition of X-Gitlab-AppId
to the Allow-Response-Headers
of a CORS Preflight request. Without this the header which is introduced in gl-application-sdk-browser!51 (merged) leads to a CORS error.
The header can't be configured directly in Snowplow unfortunately, so introducing a lightweight reverse proxy such as Caddy seemed like the easiest solution.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Check out gl-application-sdk-browser!51 (merged) for the Browser SDK
- Run
yarn build
in its main director - Run
yarn serve
in theexamples/vanilla-js
directory - Configure
http://localhost:9091
as host withinindex.js
for the vanilla js example
- Run
- Check out this MR
- Run
docker compose up
- Run
- Check the console in http://localhost:8080 that the Snowplow events http request still make it through
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.