Skip to content

Commit

Permalink
Merge pull request #18 from derekschrock/opthttps
Browse files Browse the repository at this point in the history
Accept http and https URLs for TinyURL
  • Loading branch information
davorg authored Jul 6, 2022
2 parents 542ccda + 292b017 commit f42a982
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/WWW/Shorten/TinyURL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sub makeashorterlink {
}
return undef;
}
if ($resp->content =~ m!(\Qhttps://tinyurl.com/\E\w+)!x) {
if ($resp->content =~ m!(https?\Q://tinyurl.com/\E\w+)!x) {
return $1;
}
return;
Expand All @@ -52,7 +52,7 @@ sub makealongerlink {
or Carp::croak('No TinyURL key / URL passed to makealongerlink');
$_error_message = '';
$url = "https://tinyurl.com/$url"
unless $url =~ m!^https://!i;
unless $url =~ m!^https?://!i;

# terrible, bad! skip live testing for now.
if ( $ENV{'WWW-SHORTEN-TESTING'} ) {
Expand Down

0 comments on commit f42a982

Please sign in to comment.