From 77f0ebaaa700f0b3254b1adde77deb2c15a74c4c Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 2 Sep 2014 13:20:08 +0800 Subject: Bug 1056162: add bit.ly support to bmo --- extensions/Bitly/lib/WebService.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/Bitly/lib/WebService.pm b/extensions/Bitly/lib/WebService.pm index ce235c913..e721103b0 100644 --- a/extensions/Bitly/lib/WebService.pm +++ b/extensions/Bitly/lib/WebService.pm @@ -102,6 +102,14 @@ sub _bitly { # request my $ua = LWP::UserAgent->new(agent => 'Bugzilla'); + $ua->timeout(10); + $ua->protocols_allowed(['http', 'https']); + if (my $proxy_url = Bugzilla->params->{proxy_url}) { + $ua->proxy(['http', 'https'], $proxy_url); + } + else { + $ua->env_proxy(); + } my $response = $ua->get($bitly_url); if ($response->is_error) { ThrowUserError('bitly_failure', { message => $response->message }); -- cgit v1.2.3-24-g4f1b