0001-misc-serve-svg-files-as-attachments-28002.patch
wcs/forms/common.py | ||
---|---|---|
74 | 74 |
if file.charset: |
75 | 75 |
response.set_charset(file.charset) |
76 | 76 |
if file.base_filename: |
77 |
if file.content_type.startswith('image/') or file.content_type == 'application/pdf': |
|
78 |
response.set_header( |
|
79 |
'content-disposition', 'inline; filename="%s"' % file.base_filename) |
|
80 |
else: |
|
81 |
response.set_header( |
|
82 |
'content-disposition', 'attachment; filename="%s"' % file.base_filename) |
|
77 |
content_disposition = 'attachment' |
|
78 |
if file.content_type.startswith('image/') and not file.content_type.startswith('image/svg'): |
|
79 |
content_disposition = 'inline' |
|
80 |
elif file.content_type == 'application/pdf': |
|
81 |
content_disposition = 'inline' |
|
82 |
response.set_header('content-disposition', |
|
83 |
'%s; filename="%s"' % (content_disposition, file.base_filename)) |
|
83 | 84 | |
84 | 85 |
if self.thumbnails and misc.can_thumbnail(file.content_type): |
85 | 86 |
try: |
86 |
- |