Skip to content

Commit

Permalink
Merge pull request getlantern#3169 from getlantern/fix-chkfb-issue
Browse files Browse the repository at this point in the history
Fix issue in checkfallbacks
  • Loading branch information
fffw committed Sep 18, 2015
2 parents bac022c + 2995835 commit 2ebf173
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/github.com/getlantern/checkfallbacks/checkfallbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,20 @@ func testFallbackServer(fb *client.ChainedServerInfo, workerId int) (output full
},
}
req, err := http.NewRequest("GET", "http://www.google.com/humans.txt", nil)
if *verbose {
if *verbose && err == nil {
reqStr, _ := httputil.DumpRequestOut(req, true)
output.info = []string{"\n" + string(reqStr)}
}

resp, err := c.Do(req)
if *verbose {
respStr, _ := httputil.DumpResponse(resp, true)
output.info = append(output.info, "\n"+string(respStr))
}
if err != nil {
output.err = fmt.Errorf("%v: requesting humans.txt failed: %v", fb.Addr, err)
return
} else {
if *verbose {
respStr, _ := httputil.DumpResponse(resp, true)
output.info = append(output.info, "\n"+string(respStr))
}
}
defer func() {
if err := resp.Body.Close(); err != nil {
Expand Down

0 comments on commit 2ebf173

Please sign in to comment.