From 10fdf7513522027b713c12f9a1616806d9a4f901 Mon Sep 17 00:00:00 2001 From: AlwaysHC Date: Fri, 25 Jun 2021 17:34:50 +0200 Subject: [PATCH] Get instead of Head Bitly returns the real URL for the HEAD request method. It returns https://bitly.com/a/warning?hash=... only for the GET method --- DecodeShortURLs.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DecodeShortURLs.pm b/DecodeShortURLs.pm index f44ba22..26cd077 100644 --- a/DecodeShortURLs.pm +++ b/DecodeShortURLs.pm @@ -413,7 +413,7 @@ sub recursive_lookup { syslog('info',"Found cached $short_url => $location") if $self->{syslog}; } else { # Not cached; do lookup - my $response = $self->{ua}->head($short_url); + my $response = $self->{ua}->get($short_url); if (!$response->is_redirect) { dbg("URL is not redirect: $short_url = ".$response->status_line); if ((my ($domain) = ($short_url =~ /^https?:\/\/(\S+)\//))) {