Don't die automatically on lines that don't match.
Instead, move on and don't count anything that isn't a GET.
This commit is contained in:
		
							parent
							
								
									8ab83b84e9
								
							
						
					
					
						commit
						7265718f0a
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -22,8 +22,9 @@ my %data; | |||
| 
 | ||||
| while (<>) { | ||||
|   chomp; | ||||
|   die "invalid line: $_" | ||||
|     unless /^(\S+)\s+[^"]+"\s*(HEAD|GET|POST|OPTIONS|PUT|CONNECT|PROPFIND)\s+(\S+)[\s"]/; | ||||
|   next unless /^(\S+)\s+[^"]+"\s*(GET)\s+(\S+)[\s"]/; | ||||
| #  die "invalid line: $_" | ||||
| #    unless /^(\S+)\s+[^"]+"\s*(LOCK|HEAD|GET|POST|OPTIONS|PUT|CONNECT|PROPFIND)\s+(\S+)[\s"]/; | ||||
|   my($ip, $method, $url) = ($1, $2, $3); | ||||
|   next unless $method =~ /^\s*GET\s*$/i; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Bradley M. Kuhn
						Bradley M. Kuhn