Revision 474e609a
b/snf-pithos-app/pithos/api/test/objects.py | ||
---|---|---|
599 | 599 |
meta = {'test': 'test1'} |
600 | 600 |
headers = dict(('HTTP_X_OBJECT_META_%s' % k.upper(), v) |
601 | 601 |
for k, v in meta.iteritems()) |
602 |
headers['HTTP_CONTENT_DISPOSITION'] = 'attachment; filename="%f2"' |
|
603 |
url = join_urls(self.pithos_path, self.user, cname, oname) |
|
604 |
r = self.put(url, data=data, content_type='application/pdf', **headers) |
|
605 |
self.assertEqual(r.status_code, 400) |
|
606 |
|
|
607 |
headers['HTTP_CONTENT_DISPOSITION'] = ('attachment; filename="%s"' % |
|
608 |
oname) |
|
602 | 609 |
url = join_urls(self.pithos_path, self.user, cname, oname) |
603 | 610 |
r = self.put(url, data=data, content_type='application/pdf', **headers) |
604 | 611 |
self.assertEqual(r.status_code, 201) |
b/snf-pithos-app/pithos/api/util.py | ||
---|---|---|
1059 | 1059 |
try: |
1060 | 1060 |
k.decode('ascii') |
1061 | 1061 |
v.decode('ascii') |
1062 |
if '%' in k or '%' in v: |
|
1063 |
del(request.META[k]) |
|
1064 |
request.META[unquote(k)] = smart_unicode(unquote( |
|
1065 |
v), strings_only=True) |
|
1062 | 1066 |
except UnicodeDecodeError: |
1063 | 1067 |
raise faults.BadRequest('Bad character in headers.') |
1064 |
if '%' in k or '%' in v: |
|
1065 |
del(request.META[k]) |
|
1066 |
request.META[unquote(k)] = smart_unicode(unquote( |
|
1067 |
v), strings_only=True) |
|
1068 | 1068 |
|
1069 | 1069 |
|
1070 | 1070 |
def update_response_headers(request, response): |
Also available in: Unified diff