blob: 122bf0c1ac08ca537ff9f8925509362c59e3e3bf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package Net::Riak::Role::UserAgent;
# ABSTRACT: useragent for Net::Riak
use Moose::Role;
use LWP::UserAgent;
has useragent => (
is => 'rw',
isa => 'LWP::UserAgent',
lazy => 1,
default => sub {
my $self = shift;
# The Links header Riak returns (esp. for buckets) can get really long,
# so here increase the MaxLineLength LWP will accept (default = 8192)
my %opts = @LWP::Protocol::http::EXTRA_SOCK_OPTS;
$opts{MaxLineLength} = 65_536;
@LWP::Protocol::http::EXTRA_SOCK_OPTS = %opts;
my $ua = LWP::UserAgent->new(
timeout => $self->ua_timeout
);
$ua;
}
);
1;
|