Skip to content
Permalink
Browse files

SafeRountripper -> SafeRoundtripper

  • Loading branch information
kitop committed Nov 12, 2019
1 parent b19c8f5 commit 98342c65e9d3c470dc33650ec90ecbb7c342598b
Showing with 7 additions and 7 deletions.
  1. +2 −2 api/helpers.go
  2. +2 −2 api/hooks.go
  3. +3 −3 mailer/mailme.go
@@ -188,7 +188,7 @@ func (no noLocalTransport) RoundTrip(req *http.Request) (*http.Response, error)
return no.inner.RoundTrip(req)
}

func SafeRountripper(trans http.RoundTripper, log logrus.FieldLogger) http.RoundTripper {
func SafeRoundtripper(trans http.RoundTripper, log logrus.FieldLogger) http.RoundTripper {
if trans == nil {
trans = http.DefaultTransport
}
@@ -202,7 +202,7 @@ func SafeRountripper(trans http.RoundTripper, log logrus.FieldLogger) http.Round
}

func SafeHTTPClient(client *http.Client, log logrus.FieldLogger) *http.Client {
client.Transport = SafeRountripper(client.Transport, log)
client.Transport = SafeRoundtripper(client.Transport, log)

return client
}
@@ -14,8 +14,8 @@ import (
"time"

jwt "github.com/dgrijalva/jwt-go"
"github.com/pkg/errors"
"github.com/gobuffalo/uuid"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"github.com/netlify/gotrue/conf"
@@ -75,7 +75,7 @@ func (w *Webhook) trigger() (io.ReadCloser, error) {
client := http.Client{
Timeout: timeout,
}
client.Transport = SafeRountripper(client.Transport, hooklog)
client.Transport = SafeRoundtripper(client.Transport, hooklog)

for i := 0; i < w.Retries; i++ {
hooklog = hooklog.WithField("attempt", i+1)
@@ -115,7 +115,7 @@ func (t *TemplateCache) Set(key, value string, expirationTime time.Duration) (*t

func (t *TemplateCache) fetchTemplate(url string, triesLeft int) (string, error) {
client := &http.Client{}
client.Transport = SafeRountripper(client.Transport, logrus.New())
client.Transport = SafeRoundtripper(client.Transport, logrus.New())

resp, err := client.Get(url)
if err != nil && triesLeft > 0 {
@@ -251,7 +251,7 @@ func (no noLocalTransport) RoundTrip(req *http.Request) (*http.Response, error)
return no.inner.RoundTrip(req)
}

func SafeRountripper(trans http.RoundTripper, log logrus.FieldLogger) http.RoundTripper {
func SafeRoundtripper(trans http.RoundTripper, log logrus.FieldLogger) http.RoundTripper {
if trans == nil {
trans = http.DefaultTransport
}
@@ -265,7 +265,7 @@ func SafeRountripper(trans http.RoundTripper, log logrus.FieldLogger) http.Round
}

func SafeHTTPClient(client *http.Client, log logrus.FieldLogger) *http.Client {
client.Transport = SafeRountripper(client.Transport, log)
client.Transport = SafeRoundtripper(client.Transport, log)

return client
}

0 comments on commit 98342c6

Please sign in to comment.
You can’t perform that action at this time.