Fix rewrite_path

This commit is contained in:
Emii Tatsuo 2020-12-01 20:09:35 -05:00
parent aa6c8d8a57
commit 64f54e8e58
Signed by: Emi
GPG key ID: 68FAB2E2E6DFC98B

View file

@ -227,7 +227,14 @@ impl Request {
#[cfg(feature = "scgi_srv")] {
self.script_path.as_ref().map(|base| {
let base: &Path = base.as_ref();
base.join(path.as_ref()).display().to_string()
// Make path relative
let mut path_as_path: &Path = path.as_ref().as_ref();
if path_as_path.is_absolute() {
path_as_path = (&path.as_ref()[1..]).as_ref();
}
base.join(path_as_path).display().to_string()
})
}
#[cfg(feature = "gemini_srv")] {