Do not atempt to set nil user agents.
This commit is contained in:
		
							parent
							
								
									fb6cebc8dc
								
							
						
					
					
						commit
						6abeb2c101
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -202,7 +202,9 @@ func (this *Document) LoadUriClient(uri string, client *http.Client, charset Cha
 | 
			
		|||
	if err != nil {
 | 
			
		||||
		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 {
 | 
			
		||||
		return
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue