]> iEval git - webservice-strike.git/commitdiff
Use HTTPS and include diagnostics in test
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 11 Apr 2015 09:00:17 +0000 (12:00 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 11 Apr 2015 09:00:17 +0000 (12:00 +0300)
Makefile.PL
lib/WebService/Strike.pm
lib/WebService/Strike/Torrent.pm
t/WebService-Strike.t

index a3d233e6e229269ce50138097fcddc1d6e5cf575..715e4884b152e92a343998e2b569f32625c53ebb 100644 (file)
@@ -16,7 +16,9 @@ WriteMakefile(
        PREREQ_PM         => {
                qw/Class::Accessor::Fast 0
                   Date::Parse           0
+                  IO::Socket::SSL       0
                   JSON::MaybeXS         0
+                  Mozilla::CA           0
                   Sort::ByExample       0/,
        },
        META_ADD          => {
index bf51deb54147c0fef1128d832a1032b417b88534..74a8c2b30ab05bc82315d92c245944b0bcce6614 100644 (file)
@@ -8,14 +8,14 @@ use parent qw/Exporter/;
 our @EXPORT    = qw/strike strike_search/; ## no critic (ProhibitAutomaticExportation)
 our @EXPORT_OK = qw/strike_query strike strike_search/;
 our $VERSION = '0.003';
-our $BASE_URL = 'http://getstrike.net/api/v2/torrents';
+our $BASE_URL = 'https://getstrike.net/api/v2/torrents';
 
 use JSON::MaybeXS qw/decode_json/;
 use HTTP::Tiny;
 use Sort::ByExample qw/sbe/;
 use WebService::Strike::Torrent;
 
-sub _ht { HTTP::Tiny->new(agent => "WebService-Strike/$VERSION") }
+sub _ht { HTTP::Tiny->new(agent => "WebService-Strike/$VERSION", verify_SSL => 1) }
 
 sub _query {
        my ($url) = @_;
@@ -118,7 +118,7 @@ For example:
 
 =head1 SEE ALSO
 
-L<WebService::Strike::Torrent>, L<http://getstrike.net/api/>, L<WWW::Search::Torrentz>
+L<WebService::Strike::Torrent>, L<https://getstrike.net/api/>, L<WWW::Search::Torrentz>
 
 =head1 AUTHOR
 
index 89ed2067184a57e98ba98d143c32a82c621ebc75..4268d793ec062f1d349c601d26464f43dbe71f11 100644 (file)
@@ -157,7 +157,7 @@ Both forms return a true value for success and false for failure.
 
 =head1 SEE ALSO
 
-L<WebService::Strike>, L<http://getstrike.net/api/>
+L<WebService::Strike>, L<https://getstrike.net/api/>
 
 =head1 AUTHOR
 
index 42825e19196a469ed639a02d937b50487f544db1..7713555614d44afcd20e1aa777f9a2d6c55a90a1 100644 (file)
@@ -2,12 +2,18 @@
 use strict;
 use warnings;
 
-use Test::RequiresInternet qw/getstrike.net 80/;
+use Data::Dumper qw/Dumper/;
+use Test::RequiresInternet qw/getstrike.net 443/;
 use Test::More tests => 9;
 use Try::Tiny;
 BEGIN { use_ok('WebService::Strike') };
 
-my ($t1, $t2, $t3) = strike qw/B425907E5755031BDA4A8D1B6DCCACA97DA14C04 5D4FD5A64E436A831383773F85FB38B888B9ECC9 85DF191A921C20B2DDAFF72368CAB93BA18C5ACE/;
+my ($t1, $t2, $t3);
+try {
+       ($t1, $t2, $t3) = strike qw/B425907E5755031BDA4A8D1B6DCCACA97DA14C04 5D4FD5A64E436A831383773F85FB38B888B9ECC9 85DF191A921C20B2DDAFF72368CAB93BA18C5ACE/;
+} catch {
+       diag 'Error while calling strike:', "\n", Dumper $_
+};
 
 subtest 'order' => sub {
        plan tests => 3;
This page took 0.027868 seconds and 4 git commands to generate.