From 4fb3fa54ec6b3ad89b3e5aa8c390d90cee2f3649 Mon Sep 17 00:00:00 2001 From: hplattner Date: Wed, 13 Jul 2016 15:02:17 +0200 Subject: [PATCH] add x robots tag to resources --- browser/resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/resource.py b/browser/resource.py index 2466f71..15f4518 100644 --- a/browser/resource.py +++ b/browser/resource.py @@ -197,6 +197,7 @@ class ResourceView(BaseView): context = self.context ct = context.contentType response = self.request.response + response.setHeader('X-Robots-Tag', 'noindex, nofollow') self.recordAccess('show', target=self.uniqueId) if ct.startswith('image/'): #response.setHeader('Cache-Control', 'public,max-age=86400') @@ -215,7 +216,7 @@ class ResourceView(BaseView): data = context.data if useAttachment: if filename is None: - filename = (adapted(self.context).localFilename or + filename = (adapted(self.context).localFilename or getName(self.context)) if self.typeOptions('use_title_for_download_filename'): base, ext = os.path.splitext(filename) @@ -482,4 +483,3 @@ class NoteView(DocumentView): def linkUrl(self): ad = self.typeAdapter return ad and ad.linkUrl or '' -