Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/request.py @ 6136:acfb9fa494e2
hgweb: Pass only filename instead of full path when downloading raw files.
Before this patch "filename=foo/bar" was sent and e.g. Firefox offered to save
the file as "foo-bar" instead of just "bar".
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 16 Feb 2008 17:51:30 +0100 |
parents | 948a41e77902 |
children | 1c0e7afe824a |
line wrap: on
line diff
--- a/mercurial/hgweb/request.py Sat Feb 16 13:34:11 2008 +0100 +++ b/mercurial/hgweb/request.py Sat Feb 16 17:51:30 2008 +0100 @@ -85,8 +85,8 @@ if type is not None: headers.append(('Content-Type', type)) if filename: - headers.append(('Content-Disposition', 'inline; filename=%s' % - filename)) + headers.append(('Content-Disposition', + 'inline; filename=%s' % filename.split('/')[-1])) if length: headers.append(('Content-Length', str(length))) self.header(headers)