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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add charset to text/plain Content-Type #119

Merged
merged 2 commits into from
Feb 28, 2018

Conversation

robbiet480
Copy link
Contributor

@robbiet480 robbiet480 commented Feb 28, 2018

This fixes encoding issues when viewing /metrics directly.

See also prometheus/docs#557, prometheus/prometheus#1988

expfmt/expfmt.go Outdated
@@ -26,7 +26,7 @@ const (

// The Content-Type values for the different wire protocols.
FmtUnknown Format = `<unknown>`
FmtText Format = `text/plain; version=` + TextVersion
FmtText Format = `text/plain; charset=utf-8; version=` + TextVersion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robbiet480
Copy link
Contributor Author

@brian-brazil I thought about that but couldn’t find definitive proof either way that was “legal” or not. I’ll change it to your suggestion momentarily.

@brian-brazil
Copy link
Contributor

I believe it's valid both ways offhand, but may aswell keep things consistent in case someone is doing over-simplistic handling of the header.

@robbiet480
Copy link
Contributor Author

LGTM

@brian-brazil brian-brazil merged commit 6fb6fce into prometheus:master Feb 28, 2018
@brian-brazil
Copy link
Contributor

Thanks!

alanprot pushed a commit to alanprot/common that referenced this pull request Mar 15, 2023
twitchyliquid64 added a commit to tailscale/tailscale that referenced this pull request Feb 9, 2024
Appears to be safe based on: prometheus/common#119

Signed-off-by: Tom DNetto <tom@tailscale.com>
Updates: corp#17075
twitchyliquid64 added a commit to tailscale/tailscale that referenced this pull request Feb 20, 2024
Appears to be safe based on: prometheus/common#119

Signed-off-by: Tom DNetto <tom@tailscale.com>
Updates: corp#17075
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.

None yet

3 participants