diff options
author | franck cuny <franck@lumberjaph.net> | 2009-07-23 14:35:42 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2009-07-23 14:35:42 +0200 |
commit | 53ba713cfba75c55d315710bbd1f4f9828a827f0 (patch) | |
tree | 5c195305e5e2ed8694f63d41f095562232ad6196 | |
parent | fix POD description (diff) | |
download | moosex-useragent-53ba713cfba75c55d315710bbd1f4f9828a827f0.tar.gz |
add timeout, and headers
-rw-r--r-- | lib/MooseX/UserAgent/Async.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/MooseX/UserAgent/Async.pm b/lib/MooseX/UserAgent/Async.pm index 8d68384..7cd39b1 100644 --- a/lib/MooseX/UserAgent/Async.pm +++ b/lib/MooseX/UserAgent/Async.pm @@ -17,10 +17,15 @@ sub fetch { my $request_headers = { 'Accept-Encoding' => 'gzip', }; $request_headers->{'If-Modified-Since'} = $last_modified if $last_modified; + $request_headers->{'Content-Length'} = $self->useragent_conf->{max_size} + if $self->useragent_conf->{max_size}; + $request_headers->{'From'} = $self->useragent_conf->{mail} + if $self->useragent_conf->{mail}; http_request GET => $url, headers => $request_headers, + timeout => $self->useragent_conf->{timeout}, sub { my ( $data, $headers ) = @_; my $response = HTTP::Response->new; |