diff options
author | ale <ale@incal.net> | 2018-08-31 08:29:14 +0100 |
---|---|---|
committer | ale <ale@incal.net> | 2018-08-31 08:29:14 +0100 |
commit | ee1a3d8e5278a4a4e8435f9129852b95a9c22afb (patch) | |
tree | fd7a42cfff4aed5bd2379feb35f7172287430ba2 /client.go | |
parent | b3d419486a87c9193c2fd6c16168f600876e0f73 (diff) | |
download | crawl-ee1a3d8e5278a4a4e8435f9129852b95a9c22afb.tar.gz crawl-ee1a3d8e5278a4a4e8435f9129852b95a9c22afb.zip |
Improve error checking
Detect write errors (both on the database and to the WARC output) and
abort with an error message.
Also fix a bunch of harmless lint warnings.
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -9,18 +9,18 @@ import ( var defaultClientTimeout = 60 * time.Second -var DefaultClient *http.Client - // DefaultClient returns a http.Client suitable for crawling: does not // follow redirects, accepts invalid TLS certificates, sets a // reasonable timeout for requests. +var DefaultClient *http.Client + func init() { - jar, _ := cookiejar.New(nil) + jar, _ := cookiejar.New(nil) // nolint DefaultClient = &http.Client{ Timeout: defaultClientTimeout, Transport: &http.Transport{ TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, + InsecureSkipVerify: true, // nolint }, }, CheckRedirect: func(req *http.Request, via []*http.Request) error { |