Skip to content

Commit

Permalink
refactor(assets/logging-route-service): Use defaults for http.Transport
Browse files Browse the repository at this point in the history
Clones the http.DefaultTransport rather than starting from blank, as the
default struct includes some useful defaults.
  • Loading branch information
ctlong committed Jan 29, 2024
1 parent d858685 commit 3246254
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions assets/logging-route-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"bytes"
"crypto/tls"
"io"
"log"
"net/http"
Expand Down Expand Up @@ -86,9 +85,8 @@ type LoggingRoundTripper struct {
}

func NewLoggingRoundTripper(skipSslValidation bool) *LoggingRoundTripper {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: skipSslValidation},
}
tr := http.DefaultTransport.(*http.Transport).Clone()
tr.TLSClientConfig.InsecureSkipVerify = skipSslValidation
return &LoggingRoundTripper{
transport: tr,
}
Expand Down

0 comments on commit 3246254

Please sign in to comment.