From c9c0e90c33ed5f0ea74ab1f5e6276f8d9525c5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 16 Jul 2013 10:17:13 +0200 Subject: [PATCH] truncate filename given in content-disposition (#3245) --- Avis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Avis.py b/Avis.py index 8f7c17d..f1e7bcd 100644 --- a/Avis.py +++ b/Avis.py @@ -47,7 +47,7 @@ class AvisOdt: # Tell the browser that the resulting page contains PDF response.setHeader('Content-type', 'application/%s' % fileType) response.setHeader('Content-disposition', - 'inline;filename="%s.%s"' % (self.id, fileType)) + 'inline;filename="%s.%s"' % (self.id[:200], fileType)) # Returns the doc and removes the temp file f = open(tempFileName, 'rb') doc = f.read()