From e609713899cae7f7fadb79e3112e3ae50ae90502 Mon Sep 17 00:00:00 2001 From: Marc0 Date: Wed, 28 Apr 2021 08:17:10 +0200 Subject: [PATCH] [#14] Avoid "dot in path" hickup Do not interpret "." in path names as a file extension. --- lib/Raisin/Middleware/Formatter.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Raisin/Middleware/Formatter.pm b/lib/Raisin/Middleware/Formatter.pm index f9b8bef..442d4d0 100644 --- a/lib/Raisin/Middleware/Formatter.pm +++ b/lib/Raisin/Middleware/Formatter.pm @@ -71,6 +71,8 @@ sub call { sub _accept_header_set { length(shift || '') } sub _path_has_extension { my $path = shift; + my $idx_last_slash = rindex $path, '/'; + $path = $idx_last_slash >= 0 ? substr $path, $idx_last_slash : $path; my @chunks = split /\./, $path; scalar(@chunks) > 1; }