-
Notifications
You must be signed in to change notification settings - Fork 455
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
[query] Allow GET + POST for read APIs #2055
Conversation
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
4da6682
to
acbd3e7
Compare
Codecov Report
@@ Coverage Diff @@
## master #2055 +/- ##
========================================
+ Coverage 64.8% 71.9% +7%
========================================
Files 1002 1009 +7
Lines 86353 86960 +607
========================================
+ Hits 56042 62603 +6561
+ Misses 26196 20130 -6066
- Partials 4115 4227 +112
Continue to review full report at Codecov.
|
// PromReadInstantHTTPMethod is the HTTP method used with this resource. | ||
PromReadInstantHTTPMethod = http.MethodGet | ||
var ( | ||
// PromReadInstantHTTPMethods is the valid HTTP methods used with this |
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.
meganit: PromReadInstantHTTPMethods are the valid HTTP methods...
// TODO: Move to config | ||
initialBlockAlloc = 10 | ||
) | ||
|
||
var ( | ||
// PromReadHTTPMethods is the valid HTTP methods used with this | ||
// resource. | ||
PromReadHTTPMethods = []string{ |
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.
meganit: PromReadHTTPMethods are the valid HTTP methods...
req.Header.Add("Content-Type", "application/x-www-form-urlencoded") | ||
|
||
r, err := testParseParams(req) | ||
require.Nil(t, err, "unable to parse request") |
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.
meganit: require.NoError
gives slightly more context
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, couple of very small nits
Going to merge this in, @arnikola will take up the nits as followups |
What this PR does / why we need it: Allow POST requests in coordinator read APIs. Supports common use cases such as Grafana datasources that use POST.
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: