mercurial/hgweb/request.py
changeset 6137 1c0e7afe824a
parent 6136 acfb9fa494e2
child 6212 e75aab656f46
--- a/mercurial/hgweb/request.py	Sat Feb 16 17:51:30 2008 +0100
+++ b/mercurial/hgweb/request.py	Sat Feb 16 18:12:30 2008 +0100
@@ -85,8 +85,10 @@
         if type is not None:
             headers.append(('Content-Type', type))
         if filename:
+            filename = (filename.split('/')[-1]
+                        .replace('\\', '\\\\').replace('"', '\\"'))
             headers.append(('Content-Disposition',
-                            'inline; filename=%s' % filename.split('/')[-1]))
+                            'inline; filename="%s"' % filename))
         if length:
             headers.append(('Content-Length', str(length)))
         self.header(headers)