Revision 77b8a8e3

b/snf-pithos-app/pithos/api/test/views.py
102 102
    def setUp(self):
103 103
        PithosAPITest.setUp(self)
104 104
        self.cname = self.create_container()[0]
105
        self.oname, self.odata = self.upload_object(self.cname)[:-1]
105
        self.oname, self.odata = self.upload_object(self.cname,
106
                                                    'φωτογραφία.JPG')[:-1]
106 107

  
107 108
        self.view_path = join_urls(get_service_path(
108 109
            pithos_settings.pithos_services, 'pithos_ui'), 'view')
......
141 142
        self.assertEqual(r.status_code, 200)
142 143
        self.assertTrue(r.content, self.odata)
143 144

  
145
        r = self.get('%s&disposition-type=inline' %
146
                     add_url_params(self.view_url, access_token='valid_token'))
147
        self.assertEqual(r.status_code, 200)
148
        self.assertTrue(r.content, self.odata)
149
        self.assertTrue('Content-Disposition' in r)
150
        self.assertTrue('inline' in r['Content-Disposition'])
151

  
152
        r = self.get('%s&disposition-type=attachment' %
153
                     add_url_params(self.view_url, access_token='valid_token'))
154
        self.assertEqual(r.status_code, 200)
155
        self.assertTrue(r.content, self.odata)
156
        self.assertTrue('Content-Disposition' in r)
157
        self.assertTrue('attachment' in r['Content-Disposition'])
158

  
144 159
    def test_forbidden(self):
145 160
        container = self.create_container(user='alice')[0]
146 161
        obj = self.upload_object(container, user='alice')[0]
b/snf-pithos-app/pithos/api/util.py
260 260
    disposition_type = disposition_type if disposition_type in \
261 261
        ('inline', 'attachment') else None
262 262
    if disposition_type is not None:
263
        response['Content-Disposition'] = '%s; filename=%s' % (
264
            disposition_type, meta['name'])
263
        response['Content-Disposition'] = smart_str('%s; filename=%s' % (
264
            disposition_type, meta['name']), strings_only=True)
265 265

  
266 266

  
267 267
def update_manifest_meta(request, v_account, meta):

Also available in: Unified diff