1
0
Fork 0

Fix (1st try) absolute paths for httpd url_rewrites

Thanks to Alan Teeder for guiding me into the right direction
This commit is contained in:
Torsten Dreyer 2014-09-24 20:50:10 +02:00
parent 2859400336
commit c0c82f4f7b

View file

@ -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);
}
}