From c0c82f4f7bdf8461c4903f2e95a28f301dcbef08 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Wed, 24 Sep 2014 20:50:10 +0200 Subject: [PATCH] Fix (1st try) absolute paths for httpd url_rewrites Thanks to Alan Teeder for guiding me into the right direction --- src/Network/http/httpd.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Network/http/httpd.cxx b/src/Network/http/httpd.cxx index 3fb280dc9..9d41b66f2 100644 --- a/src/Network/http/httpd.cxx +++ b/src/Network/http/httpd.cxx @@ -490,9 +490,11 @@ void MongooseHttpd::init() string & rhs = rw_entries[1]; if (false == rewrites.empty()) rewrites.append(1, ','); rewrites.append(lhs).append(1, '='); - if (rhs[0] == '/') { + SGPath targetPath(rhs); + if (targetPath.isAbsolute() ) { rewrites.append(rhs); } else { + // don't use targetPath here because SGPath strips trailing '/' rewrites.append(fgRoot).append(1, '/').append(rhs); } } -- 2.39.5