diff -r acfb9fa494e2 -r 1c0e7afe824a mercurial/hgweb/request.py --- 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)