Files
telemetry/.chloggen/add-cors-exposed-headers.yaml
Rajneesh ChaudharyandGitHub 54bab503b4 confighttp: add ExposedHeaders to CORSConfig (#15119)
`CORSConfig` maps `AllowedOrigins`, `AllowedHeaders`, and `MaxAge` into
`cors.Options`, but doesn't map `ExposedHeaders` even though `rs/cors`
supports it. This means there's no way to set
`Access-Control-Expose-Headers` through receiver config — anyone who
needs it has to write a custom middleware.

This came up in jaegertracing/jaeger#8128 where the Jaeger UI needs
specific headers exposed over CORS but has to work around this gap with
a hand-rolled middleware.

### Changes
- Add `ExposedHeaders []string` to `CORSConfig`
- Wire it into `cors.Options` in `ToServer()`
- Add test
- Update README

Signed-off-by: Rajneesh Chaudhary <[email protected]>
2026-06-01 21:30:33 +00:00

26 lines
1.1 KiB
YAML

# Use this changelog template to create an entry for release notes.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement
# The name of the component, or a single word describing the area of concern, (e.g. receiver/otlp)
component: pkg/confighttp
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add `ExposedHeaders` field to `CORSConfig` to allow setting the `Access-Control-Expose-Headers` response header.
# One or more tracking issues or pull requests related to the change
issues: [15119]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user, api]