Subject: | [patch] HTTP::Recorder clutters log with favicon requests |
--- Recorder.pm.1 Tue Jun 22 17:31:06 2004
+++ lib/HTTP/Recorder.pm Tue Jun 22 17:31:34 2004
@@ -90,6 +90,8 @@
$self->{control} = $args{control} || "http-recorder";
$self->{logger} = $args{logger} ||
new HTTP::Recorder::Logger(file => $args{file});
+ $self->{ignore_favicon} = $args{ignore_favicon}
+ || 0;
return $self;
}
@@ -133,6 +135,15 @@
sub logger { shift->_elem('logger', @_); }
+=head2 B<$agent->ignore_favicon([$value])>
+
+Get or set ignore_favicon flag that causes L<HTTP::Recorder> to skip
+logging requests which match /favicon\.ico$/.
+
+=cut
+
+sub ignore_favicon { shift->_elem('ignore_favicon', @_); }
+
=head2 B<$agent->file([$value])>
Get or set the filename for generated scripts. The default is
@@ -191,7 +202,9 @@
$content,
);
} else {
- $request = $self->modify_request ($request);
+ $request = $self->modify_request ($request)
+ unless $self->{ignore_favicon}
+ && $request->uri->path =~ /favicon\.ico$/;
$response = $self->SUPER::send_request( $request );