my fork of the bluesky client

Merge pull request #5800 from brianolson/ipcc-client-fix

one http.Client for server instead of new per /ipcc

authored by

Brian Olson and committed by
GitHub
9a91746f 444c6e6a

+10 -8
+10 -8
bskyweb/cmd/bskyweb/server.go
··· 38 38 httpd *http.Server 39 39 xrpcc *xrpc.Client 40 40 cfg *Config 41 + 42 + ipccClient http.Client 41 43 } 42 44 43 45 type Config struct { ··· 104 106 linkHost: linkHost, 105 107 ipccHost: ipccHost, 106 108 staticCDNHost: staticCDNHost, 109 + }, 110 + ipccClient: http.Client{ 111 + Transport: &http.Transport{ 112 + TLSClientConfig: &tls.Config{ 113 + InsecureSkipVerify: true, 114 + }, 115 + }, 107 116 }, 108 117 } 109 118 ··· 584 593 } 585 594 ipccUrlBuilder.Path = "ipccdata.IpCcService/Lookup" 586 595 ipccUrl := ipccUrlBuilder.String() 587 - cl := http.Client{ 588 - Transport: &http.Transport{ 589 - TLSClientConfig: &tls.Config{ 590 - InsecureSkipVerify: true, 591 - }, 592 - }, 593 - } 594 596 postBodyReader := bytes.NewReader(request) 595 - response, err := cl.Post(ipccUrl, "application/json", postBodyReader) 597 + response, err := srv.ipccClient.Post(ipccUrl, "application/json", postBodyReader) 596 598 if err != nil { 597 599 log.Warnf("ipcc backend error %s", err) 598 600 return c.JSON(500, IPCCResponse{})