mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Use different user-agent for twitter links (#16210)
This commit is contained in:
@@ -136,7 +136,7 @@ func dialContextFilter(dial DialContextFunction, allowHost func(host string) boo
|
||||
}
|
||||
}
|
||||
|
||||
func NewTransport(enableInsecureConnections bool, allowHost func(host string) bool, allowIP func(ip net.IP) bool) http.RoundTripper {
|
||||
func NewTransport(enableInsecureConnections bool, allowHost func(host string) bool, allowIP func(ip net.IP) bool) *MattermostTransport {
|
||||
dialContext := (&net.Dialer{
|
||||
Timeout: ConnectTimeout,
|
||||
KeepAlive: 30 * time.Second,
|
||||
|
||||
@@ -25,7 +25,7 @@ type HTTPService interface {
|
||||
// - A timeout for end-to-end requests
|
||||
// - A Mattermost-specific user agent header
|
||||
// - Additional security for untrusted and insecure connections
|
||||
MakeTransport(trustURLs bool) http.RoundTripper
|
||||
MakeTransport(trustURLs bool) *MattermostTransport
|
||||
}
|
||||
|
||||
type HTTPServiceImpl struct {
|
||||
@@ -52,7 +52,7 @@ func (h *HTTPServiceImpl) MakeClient(trustURLs bool) *http.Client {
|
||||
}
|
||||
}
|
||||
|
||||
func (h *HTTPServiceImpl) MakeTransport(trustURLs bool) http.RoundTripper {
|
||||
func (h *HTTPServiceImpl) MakeTransport(trustURLs bool) *MattermostTransport {
|
||||
insecure := h.configService.Config().ServiceSettings.EnableInsecureOutgoingConnections != nil && *h.configService.Config().ServiceSettings.EnableInsecureOutgoingConnections
|
||||
|
||||
if trustURLs {
|
||||
|
||||
Reference in New Issue
Block a user