[v9.4.x] Prometheus: Fix fallback http method when no http method specified in jsonData (#68434)
Prometheus: Fix fallback http method when no http method specified in jsonData (#65229)
Use POST as default if no http method specified in jsonData
(cherry picked from commit 959349d191)
This commit is contained in:
1 parent
f5da579af9
commit
fb9429b1f7
1 file changed
+4
@@ -30,6 +30,10 @@ func New(
|
||||
}
|
||||
httpMethod, _ := maputil.GetStringOptional(jsonData, "httpMethod")
|
||||
|
||||
if httpMethod == "" {
|
||||
httpMethod = http.MethodPost
|
||||
}
|
||||
|
||||
return &Resource{
|
||||
log: plog,
|
||||
promClient: client.NewClient(httpClient, httpMethod, settings.URL),
|
||||
|
||||
Reference in new issue
Block a user