Skip to content

Commit

Permalink
Return text from /q/metrics when the Accept header contains html
Browse files Browse the repository at this point in the history
This makes the endpoint more friendly for browsers

See: https://quarkusio.zulipchat.com/#narrow/stream/187030-users
(cherry picked from commit dbd44bb)
  • Loading branch information
geoand authored and gsmet committed Feb 8, 2023
1 parent 110175e commit 3ed1369
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private String chooseContentType(String acceptHeader) {
if (acceptHeader == null) {
return TextFormat.CONTENT_TYPE_OPENMETRICS_100;
}
if (acceptHeader.startsWith("text/plain")) {
if (acceptHeader.contains("text/plain") || acceptHeader.contains("text/html")) {
return TextFormat.CONTENT_TYPE_004;
}
return TextFormat.CONTENT_TYPE_OPENMETRICS_100;
Expand Down

0 comments on commit 3ed1369

Please sign in to comment.