Revision b7df5775 snf-pithos-app/pithos/api/util.py

b/snf-pithos-app/pithos/api/util.py
215 215

  
216 216
def get_object_headers(request):
217 217
    content_type = request.META.get('CONTENT_TYPE', None)
218
    if content_type:
219
        try:
220
            content_type.decode('ascii')
221
            # TODO: check format ?
222
        except UnicodeDecodeError:
223
            raise faults.BadRequest('Bad characters in Content-Type.')
224

  
218 225
    meta = get_header_prefix(request, 'X-Object-Meta-')
219 226
    check_meta_headers(meta)
220 227
    if request.META.get('HTTP_CONTENT_ENCODING'):

Also available in: Unified diff