feat(outputs.http): Allow PATCH method (#13651)

This commit is contained in:
Joshua Powers 2023-07-21 03:31:40 -06:00 committed by GitHub
parent 5d51052941
commit 25f545ccb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ to use them.
## Timeout for HTTP message
# timeout = "5s"
## HTTP method, one of: "POST" or "PUT"
## HTTP method, one of: "POST" or "PUT" or "PATCH"
# method = "POST"
## HTTP Basic Auth credentials

View File

@ -85,7 +85,7 @@ func (h *HTTP) Connect() error {
h.Method = http.MethodPost
}
h.Method = strings.ToUpper(h.Method)
if h.Method != http.MethodPost && h.Method != http.MethodPut {
if h.Method != http.MethodPost && h.Method != http.MethodPut && h.Method != http.MethodPatch {
return fmt.Errorf("invalid method [%s] %s", h.URL, h.Method)
}

View File

@ -6,7 +6,7 @@
## Timeout for HTTP message
# timeout = "5s"
## HTTP method, one of: "POST" or "PUT"
## HTTP method, one of: "POST" or "PUT" or "PATCH"
# method = "POST"
## HTTP Basic Auth credentials