Revision 53cff70c

b/docs/source/devguide.rst
27 27
=========================  ================================
28 28
Revision                   Description
29 29
=========================  ================================
30
0.8 (Jan 19, 2012)         Update allowed versioning values.
30
0.8 (Jan 24, 2012)         Update allowed versioning values.
31 31
\                          Change policy/meta formatting in JSON/XML replies.
32 32
\                          Document that all non-ASCII characters in headers should be URL-encoded.
33 33
\                          Support metadata-based queries when listing objects at the container level.
......
35 35
\                          Add object UUID field.
36 36
\                          Always reply with the MD5 in the ETag.
37 37
\                          Note that ``/login`` will only work if an external authentication system is defined.
38
\                          Include option to ignore Content-Type on ``COPY``/``MOVE``.
38 39
0.7 (Nov 21, 2011)         Suggest upload/download methods using hashmaps.
39 40
\                          Propose syncing algorithm.
40 41
\                          Support cross-account object copy and move.
......
870 871
COPY
871 872
""""
872 873

  
874
======================  ===================================
875
Request Parameter Name  Value
876
======================  ===================================
877
ignore_content_type     Ignore the supplied Content-Type
878
======================  ===================================
879

  
880
|
881

  
873 882
====================  ================================
874 883
Request Header Name   Value
875 884
====================  ================================
......
887 896
X-Object-Meta-*       Optional user defined metadata
888 897
====================  ================================
889 898

  
890
:sup:`*` *When using django locally with the supplied web server, do provide a valid Content-Type, as a type of text/plain is applied by default to all requests.*
899
:sup:`*` *When using django locally with the supplied web server, use the ignore_content_type parameter, or do provide a valid Content-Type, as a type of text/plain is applied by default to all requests. Client software should always state ignore_content_type, except when a Content-Type is explicitly defined by the user.*
891 900

  
892 901
Refer to ``PUT``/``POST`` for a description of request headers. Metadata is also copied, updated with any values defined. Sharing/publishing options are not copied.
893 902

  
......
1077 1086
* Object create using ``POST`` to support standard HTML forms.
1078 1087
* Partial object updates through ``POST``, using the ``Content-Length``, ``Content-Type``, ``Content-Range`` and ``Transfer-Encoding`` headers. Use another object's data to update with ``X-Source-Object`` and ``X-Source-Version``. Truncate with ``X-Object-Bytes``.
1079 1088
* Include new version identifier in replies for object replace/change requests.
1080
* Object ``MOVE`` support.
1089
* Object ``MOVE`` support and ``ignore_content_type`` parameter in both ``COPY`` and ``MOVE``.
1081 1090
* Conditional object create/update operations, using ``If-Match`` and ``If-None-Match`` headers.
1082 1091
* Time-variant account/container listings via the ``until`` parameter.
1083 1092
* Object versions - parameter ``version`` in ``HEAD``/``GET`` (list versions with ``GET``), ``X-Object-Version-*`` meta in replies, ``X-Source-Version`` in ``PUT``/``COPY``.
b/pithos/api/util.py
302 302
def copy_or_move_object(request, src_account, src_container, src_name, dest_account, dest_container, dest_name, move=False):
303 303
    """Copy or move an object."""
304 304
    
305
    if 'ignore_content_type' in request.GET and 'CONTENT_TYPE' in request.META:
306
        del(request.META['CONTENT_TYPE'])
305 307
    meta, permissions, public = get_object_headers(request)
306 308
    src_version = request.META.get('HTTP_X_SOURCE_VERSION')
307 309
    try:
b/pithos/lib/client.py
448 448
        account = account or self.account
449 449
        path = '/%s/%s/%s' % (account, dst_container, dst_object)
450 450
        headers = {} if not headers else headers
451
        params = {}
451 452
        for k, v in meta.items():
452 453
            headers['x-object-meta-%s' % k] = v
453 454
        if remove:
......
456 457
            headers['x-copy-from'] = '/%s/%s' % (src_container, src_object)
457 458
        headers['content_length'] = 0
458 459
        if content_type:
459
            headers['content_type'] = content_type 
460
        return self.put(path, headers=headers)
460
            headers['content_type'] = content_type
461
        else:
462
            params['ignore_content_type'] = ''
463
        return self.put(path, headers=headers, params=params)
461 464
    
462 465
    def copy_object(self, src_container, src_object, dst_container, dst_object,
463 466
                   meta={}, account=None, content_type=None, **headers):

Also available in: Unified diff