Skip to content

Commit

Permalink
Merge pull request #712 from bbrtj/master
Browse files Browse the repository at this point in the history
Avoid try block just for checking $object->isa
  • Loading branch information
miyagawa authored Jun 22, 2024
2 parents 9bca3c3 + 17b681b commit fa47e35
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/HTTP/Message/PSGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ use Carp ();
use HTTP::Status qw(status_message);
use URI::Escape ();
use Plack::Util;
use Try::Tiny;
use Scalar::Util ();

my $TRUE = (1 == 1);
my $FALSE = !$TRUE;

sub req_to_psgi {
my $req = shift;

unless (try { $req->isa('HTTP::Request') }) {
Carp::croak("Request is not HTTP::Request: $req");
}
Carp::croak("Request is not HTTP::Request: $req")
unless Scalar::Util::blessed $req && $req->isa('HTTP::Request');

# from HTTP::Request::AsCGI
my $host = $req->header('Host');
Expand Down

0 comments on commit fa47e35

Please sign in to comment.