summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TO_FIX.md1
-rwxr-xr-xgmi.pl6
2 files changed, 3 insertions, 4 deletions
diff --git a/TO_FIX.md b/TO_FIX.md
index 1c95988..0a51032 100644
--- a/TO_FIX.md
+++ b/TO_FIX.md
@@ -5,7 +5,6 @@ add systemd unit?
gmi.pl needs to accept an arguemnt, where the config.toml is located.
remove magic numbers
-redirection bug where path = /share/dir, redirection says '30 share/dir/' resulting in '/share/share/dir/'
in dir_listing, if a file has white space, then it will not properly display.
server does not do anything with '%20' (whitespace) in path at all.
diff --git a/gmi.pl b/gmi.pl
index 2ccb072..b292ba2 100755
--- a/gmi.pl
+++ b/gmi.pl
@@ -7,7 +7,7 @@ use warnings;
use 5.010;
#use diagnostics;
-our $VERSION = 'v0.0.4';
+our $VERSION = 'v0.0.5';
# Modules
use IO::Socket::SSL; # CPAN
@@ -405,8 +405,8 @@ while () {
}
elsif (-d $doc_loc) {
# make sure 'dir' is 'dir/'
- if (substr($doc_loc,-1,1) ne '/') {
- speak($cl, 'redirect', "$path/");
+ if (substr($doc_loc,-1,1) ne '/') {
+ speak($cl, 'redirect', @{ split_url_path($path, 256) }[-1]. "/");
goto CLOSE;
}