chore: minor refactor of webhook module

This commit is contained in:
Julien Neuhart
2023-11-20 20:39:49 +01:00
parent 4d1a569269
commit 793e65bac0
6 changed files with 159 additions and 153 deletions
+4 -4
View File
@@ -16,9 +16,9 @@ import (
type client struct {
url string
method string
errorURL string
errorUrl string
errorMethod string
extraHTTPHeaders map[string]string
extraHttpHeaders map[string]string
startTime time.Time
client *retryablehttp.Client
@@ -29,7 +29,7 @@ type client struct {
func (c client) send(body io.Reader, headers map[string]string, erroed bool) error {
URL := c.url
if erroed {
URL = c.errorURL
URL = c.errorUrl
}
method := c.method
@@ -45,7 +45,7 @@ func (c client) send(body io.Reader, headers map[string]string, erroed bool) err
req.Header.Set("User-Agent", "Gotenberg")
// Extra HTTP headers are the custom headers from the user.
for key, value := range c.extraHTTPHeaders {
for key, value := range c.extraHttpHeaders {
req.Header.Set(key, value)
}