Fix url rewriting

Only apply pathTranslation if a path hasn't been rewritten
(they're always relative paths), or if the rewritten path
didn't begin with '/'.
Esse commit está contido em:
mwilliams
2013-07-10 08:21:37 -07:00
commit de Sara Golemon
commit 47970e99d7
+7 -3
Ver Arquivo
@@ -234,10 +234,14 @@ bool RequestURI::virtualFileExists(const VirtualHost *vhost,
AttachString);
if (!vhost->getDocumentRoot().empty()) {
string fullname = canon.data();
while (fullname[0] == '/') {
fullname = fullname.substr(1);
int i = 0;
while (i < fullname.size() && fullname[i] == '/') ++i;
if (i) {
fullname = fullname.substr(i);
}
if (!i || !m_rewritten) {
fullname = pathTranslation + fullname;
}
fullname = pathTranslation + fullname;
m_path = fullname;
m_absolutePath = String(sourceRoot) + m_path;
processExt();