Client/UA/Hijk.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 46 SCAR 24.8
CC
3
Cov
0%
after_request
12.0
send_http_request
2.0
before_request
2.0
CRAP 12.0
1 package PONAPI::Client::UA::Hijk;
2 # ABSTRACT: A wrapper for a Hijk UA
3  
4 ################################################################################
5 ################################################################################
6  
7 use strict;
8 use warnings;
9  
10 use Moose;
11 use Hijk;
12  
13 use constant OLD_HIJK => $Hijk::VERSION lt '0.16';
14  
15 with 'PONAPI::Client::Role::UA';
16  
17 ################################################################################
18 ################################################################################
19  
20 sub send_http_request {
21 $_[1]->{parse_chunked} = 1;
22 return Hijk::request($_[1]);
23 }
24  
25 ################################################################################
26 ################################################################################
27  
28 sub before_request { }
29  
30 ################################################################################
31 ################################################################################
32  
33 sub after_request {
34 my ($self, $response) = @_;
35  
36 if ( OLD_HIJK ) {
37 if ( ($response->{head}{'Transfer-Encoding'}||'') eq 'chunked' ) {
38 die "Got a chunked response from the server, but this version of Hijk can't handle those; please upgrade to at least Hijk 0.16";
39 }
40 }
41 }
42 ################################################################################
43 ################################################################################
44  
45 no Moose;
46 __PACKAGE__->meta->make_immutable();
47  
48 1;
49  
50 ################################################################################
51 ################################################################################
52  
53 __END__
54  
55 =pod
56  
57 =encoding UTF-8
58  
59 =head1 NAME
60  
61 PONAPI::Client::UA::Hijk - A wrapper for a Hijk UA
62  
63 =head1 VERSION
64  
65 version 0.002011
66  
67 =head1 AUTHORS
68  
69 =over 4
70  
71 =item *
72  
73 Mickey Nasriachi <mickey@cpan.org>
74  
75 =item *
76  
77 Stevan Little <stevan@cpan.org>
78  
79 =item *
80  
81 Brian Fraser <hugmeir@cpan.org>
82  
83 =back
84  
85 =head1 COPYRIGHT AND LICENSE
86  
87 This software is copyright (c) 2019 by Mickey Nasriachi, Stevan Little, Brian Fraser.
88  
89 This is free software; you can redistribute it and/or modify it under
90 the same terms as the Perl 5 programming language system itself.
91  
92 =cut