aboutsummaryrefslogtreecommitdiffstats
path: root/redirect.cgi
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2020-05-15 10:34:47 +0200
committerDennis Eriksen <d@ennis.no>2020-05-15 10:34:47 +0200
commit9f428482a4ed20f36512f8255e8e80075c239af5 (patch)
tree91870737334d6db68f2ac69ea2648f3d24d7f1d2 /redirect.cgi
parentwe now support curling the form without getting all of the HTML in response (diff)
downloadpurl-9f428482a4ed20f36512f8255e8e80075c239af5.tar.gz
I'm adding a + in front of the short URL, because I want to use another domain for this. It should probably be optional, but what the heck. I'm probably the only one using this.
Diffstat (limited to 'redirect.cgi')
-rwxr-xr-xredirect.cgi1
1 files changed, 1 insertions, 0 deletions
diff --git a/redirect.cgi b/redirect.cgi
index 9af5ed9..e95b74b 100755
--- a/redirect.cgi
+++ b/redirect.cgi
@@ -15,6 +15,7 @@ my $dbh = DBI->connect("dbi:Pg:dbname=purl") or die $DBI::errstr;
# set the short
my $short = scalar $ENV{REQUEST_URI};
$short =~ s/^\///;
+$short =~ s/^\+//; # If short starts with +, remove it.
# SQL Query
my $query = qq(SELECT shorts.url FROM shorts WHERE shorts.short = ?;);