Closed derekschrock closed 2 years ago
At least for the time being to fix the shortener:
https?://
--- /usr/local/lib/perl5/site_perl/WWW/Shorten/TinyURL.pm 2021-03-12 12:48:25.000000000 -0500
+++ TinyURL.pm 2022-07-03 00:55:47.737290000 -0400
@@ -41,7 +41,7 @@
}
return undef;
}
- if ($resp->content =~ m!(\Qhttps://tinyurl.com/\E\w+)!x) {
+ if ($resp->content =~ m!(https?://tinyurl.com/\w+)!x) {
return $1;
}
return;
@@ -52,7 +52,7 @@
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'} ) {
@derekschrock Could you please submit this as a PR. Thanks.
tinyurl.com fixed it on their end. It's now returning https:// links.
But I'm thinking we should still implement your fix in case it breaks again in the future.
Yeah, I was thinking the same thing. I'll take a look at it this week to make it work with both http and https for shorter and longer.
A year later #14 tinyurl.com is back to returning http:// links. I've filed a ticket to see if this is expected. Report back once/if they reply. However, it seems that maybe reverting that PR could be the fix.