-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(influxql): set correct Content-Type on v1 query responses #20565
Conversation
3dcef51
to
5baf4ee
Compare
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.
Looks good, @danxmoran – I'd caution against logging the invalid accept headers to the logs, as these represent a client issue rather than a server issue. You could consider logging them as Debug level, which should be excluded from regular logs, but they are not a warning that an administrator needs to worry about.
http/legacy/influxqld_handler.go
Outdated
formatString := r.Header.Get("Accept") | ||
encodingFormat := influxql.EncodingFormatFromMimeType(formatString) | ||
if encodingFormat == influxql.EncodingFormatUnknown { | ||
h.Logger.Warn("request included unknown format in Accept header, using application/json", zap.String("format", formatString)) |
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.
Not sure there is value in logging invalid Accept
headers. It is a client issue and could result in spamming the logs.
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'll remove it
- in: header | ||
name: Accept | ||
schema: | ||
type: string | ||
description: Specifies how query results should be encoded in the response. | ||
default: application/json | ||
enum: | ||
- application/json | ||
- application/csv | ||
- text/csv | ||
- application/x-msgpack |
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.
👏
e7ba94a
to
f4f3a95
Compare
fix(influxql): set correct Content-Type on v1 query responses (influxdata#20565)
Closes #20514
See reasoning for this approach in the issue.