From 4bbd1931281df6c15b67bbe37883a482fc632fa3 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 6 Dec 2016 14:31:53 +0000 Subject: Fix previous commit --- lib/CatDap/Controller/user.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CatDap/Controller/user.pm b/lib/CatDap/Controller/user.pm index 8c14cfd..6f8ac9f 100644 --- a/lib/CatDap/Controller/user.pm +++ b/lib/CatDap/Controller/user.pm @@ -118,7 +118,8 @@ sub get_keyprefix : Private { if ($c->req->address =~ m/:/) { # For IPv6 the first 3 can be special and shared by many people, # bytes 6-8 are more interesting - $keyprefix = sprintf( "%02x%02x%02x", splice(5, 3, split /:/, $c->req->address)); + my @address_chunks = split /:/, $c->req->address; + $keyprefix = sprintf( "%02x%02x%02x", splice(@address_chunks, 5, 3)); } else { $keyprefix = sprintf( "%02x%02x%02x", split /\./, $c->req->address ); -- cgit v1.2.1