-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Loki: Querier APIs respond JSON Content-Type #2665
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2665 +/- ##
==========================================
- Coverage 61.46% 61.44% -0.02%
==========================================
Files 173 173
Lines 13421 13428 +7
==========================================
+ Hits 8249 8251 +2
- Misses 4422 4428 +6
+ Partials 750 749 -1
|
Nice should the query-frontend have the same middleware ? Can you also sign the CLA. Again thank you ! |
I think there should be. Has been signed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for this change !
pkg/util/server/middleware.go
Outdated
func ResponseJSONMiddleware() middleware.Interface { | ||
return middleware.Func(func(next http.Handler) http.Handler { | ||
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { | ||
w.Header().Add("Content-Type", "application/json; charset=UTF-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if Set
would be better here ? So that whatever it was it is replaced. Pretty sure it's no a big deal here, I'll merge it as is tomorrow if you don't have time to make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. This should be a replacement, not an Add
. I'll fix it right now.
What this PR does / why we need it:
Add json response so that http client tool can display data better.