Do not atempt to set nil user agents.
This commit is contained in:
parent
fb6cebc8dc
commit
6abeb2c101
|
@ -202,7 +202,9 @@ func (this *Document) LoadUriClient(uri string, client *http.Client, charset Cha
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err) // TODO
|
log.Fatalln(err) // TODO
|
||||||
}
|
}
|
||||||
req.Header.Set("User-Agent", this.useragent)
|
if len(this.useragent) > 1 {
|
||||||
|
req.Header.Set("User-Agent", this.useragent)
|
||||||
|
}
|
||||||
|
|
||||||
if r, err = client.Do(req); err != nil {
|
if r, err = client.Do(req); err != nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue