Skip to content

Flexible way to set HTTP response headers. See issue #48#49

Open
mr-ns wants to merge 3 commits into
AlexanderThaller:masterfrom
mr-ns:master
Open

Flexible way to set HTTP response headers. See issue #48#49
mr-ns wants to merge 3 commits into
AlexanderThaller:masterfrom
mr-ns:master

Conversation

@mr-ns

@mr-ns mr-ns commented Jul 31, 2025

Copy link
Copy Markdown

No description provided.

mr-ns added 3 commits July 31, 2025 12:51
Provide a `with_header()` method on `Builder` allowing a HTTP header to be
included in the HTTP response when the exporter is scraped. The method can
be called multiple times to add any number of headers.

By placing this on `Builder` we parse the header string into a `tiny_http`
`Header` object just once, and ensure the header is valid before starting
the exporter.
Prometheus scrapers want a specific `Content-Type` header, so set that by
default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant