Skip to content

Commit

Permalink
Fix code flow and response check
Browse files Browse the repository at this point in the history
  • Loading branch information
HavrilaJ committed May 15, 2023
1 parent c947b74 commit fa29fbf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pakiti-client
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,14 @@ sub https {
eval { require LWP::UserAgent; LWP::UserAgent->import; };
if ($@) {
if ($Option{"disable-tls-checks"}) {
$response = `curl -sik -o /dev/null -w "%{http_code}" -X POST $url -d "$report"`;
$response = `curl -sqk -X POST $url -d "$report"`;
} else {
$response = `curl -si -o /dev/null -w "%{http_code}" -X POST $url -d "$report"`;
}
if ($response == "200") {
print(STDERR "report successfully sent\n") if -t STDERR;
print "OK\n";
} else {
die($response);
$response = `curl -sq -X POST $url -d "$report"`;
}
($response =~ /OK$/) or die($response);

print(STDERR "report successfully sent\n") if -t STDERR;
print($response);
} else {
my $ua = LWP::UserAgent->new();
push @{$ua->requests_redirectable}, 'POST';
Expand Down

0 comments on commit fa29fbf

Please sign in to comment.