diff options
| author | Adnan Maolood <[email protected]> | 2020-11-24 21:49:24 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2020-11-24 21:49:24 -0500 |
| commit | ab1db34f02939c59864d82f9d220b39054e46baf (patch) | |
| tree | e7961367347b02fee82e23b6be496a1dda56d2c9 /client.go | |
| parent | Escape path character in certificate scopes (diff) | |
| download | go-gemini-ab1db34f02939c59864d82f9d220b39054e46baf.tar.xz go-gemini-ab1db34f02939c59864d82f9d220b39054e46baf.zip | |
Fix client locking up on redirects
Diffstat (limited to 'client.go')
| -rw-r--r-- | client.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -77,13 +77,13 @@ func (c *Client) Get(url string) (*Response, error) { // Do performs a Gemini request and returns a Gemini response. func (c *Client) Do(req *Request) (*Response, error) { + c.mu.Lock() + defer c.mu.Unlock() + return c.do(req, nil) } func (c *Client) do(req *Request, via []*Request) (*Response, error) { - c.mu.Lock() - defer c.mu.Unlock() - // Connect to the host config := &tls.Config{ InsecureSkipVerify: true, |