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 {
|
||||
log.Fatalln(err) // TODO
|
||||
}
|
||||
if len(this.useragent) > 1 {
|
||||
req.Header.Set("User-Agent", this.useragent)
|
||||
}
|
||||
|
||||
if r, err = client.Do(req); err != nil {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue