diff --git a/src/server.rs b/src/server.rs
index bf89df0..150d4e6 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -829,8 +829,8 @@ impl PathItem {
HTTP/1.1 200 OK
"#,
- escape_str_pcdata(prefix),
- escape_str_pcdata(&self.name),
+ prefix,
+ encode_uri(&self.name),
escape_str_pcdata(&self.base_name),
mtime
),
@@ -847,8 +847,8 @@ impl PathItem {
HTTP/1.1 200 OK
"#,
- escape_str_pcdata(prefix),
- escape_str_pcdata(&self.name),
+ prefix,
+ encode_uri(&self.name),
escape_str_pcdata(&self.base_name),
self.size.unwrap_or_default(),
mtime