Skip to content

Commit

Permalink
check for error before setting the header
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Blose committed Nov 21, 2015
1 parent 12b7072 commit 0d99ab0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/github.com/getlantern/chained/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ func (d *dialer) sendCONNECT(network, addr string, conn net.Conn) error {
}

req, err := buildCONNECTRequest(addr, d.OnRequest)
req.Header.Set("X-LANTERN-AUTH-TOKEN", d.Token)

if err != nil {
return fmt.Errorf("Unable to construct CONNECT request: %s", err)
}

req.Header.Set("X-LANTERN-AUTH-TOKEN", d.Token)
err = req.Write(conn)
if err != nil {
return fmt.Errorf("Unable to write CONNECT request: %s", err)
Expand Down

0 comments on commit 0d99ab0

Please sign in to comment.