diff --git a/doc/http.go b/doc/http.go index 5b9494e34..58e574735 100644 --- a/doc/http.go +++ b/doc/http.go @@ -18,7 +18,7 @@ import ( var userAgent = "go application" var ( - dialTimeout = flag.Duration("dial_timeout", 5*time.Second, "Timeout for dialing an HTTP connection.") + dialTimeout = flag.Duration("dial_timeout", 30*time.Second, "Timeout for dialing an HTTP connection.") readTimeout = flag.Duration("read_timeout", 10*time.Second, "Timeoout for reading an HTTP response.") writeTimeout = flag.Duration("write_timeout", 5*time.Second, "Timeout writing an HTTP request.") ) @@ -77,6 +77,7 @@ func httpGet(client *http.Client, url string, header http.Header) (io.ReadCloser if err != nil { return nil, &RemoteError{req.URL.Host, err} } + if resp.StatusCode == 200 { return resp.Body, nil }