From: Torsten Dreyer Date: Wed, 24 Sep 2014 18:50:10 +0000 (+0200) Subject: Fix (1st try) absolute paths for httpd url_rewrites X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c0c82f4f7bdf8461c4903f2e95a28f301dcbef08;p=flightgear.git Fix (1st try) absolute paths for httpd url_rewrites Thanks to Alan Teeder for guiding me into the right direction --- 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); } }