Bug #1734

A COPY/MOVE request will revert Content-Type to text/plain

Added by Antony Chazapis over 12 years ago. Updated over 11 years ago.

Status:Closed Start date:12/05/2011
Priority:Medium Due date:
Assignee:- % Done:

100%

Category:Pithos Spent time: -
Target version:-

Description

Reproduced with the server running locally.

imac:tools chazapis$ ./pithos-sh put p/R
imac:tools chazapis$ ./pithos-sh copy p/R p/RR
imac:tools chazapis$ ./pithos-sh ls -l p
R
                         bytes: 0
                  content_type: application/octet-stream
                          hash: d41d8cd98f00b204e9800998ecf8427e
                 last_modified: 2011-12-05T17:33:09.519587+00:00
                 x_object_hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
          x_object_modified_by: chazapis
              x_object_version: 108
    x_object_version_timestamp: 1323106389.519587
RR
                         bytes: 0
                  content_type: text/plain
                          hash: d41d8cd98f00b204e9800998ecf8427e
                 last_modified: 2011-12-05T17:33:18.643417+00:00
                 x_object_hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
          x_object_modified_by: chazapis
              x_object_version: 109
    x_object_version_timestamp: 1323106398.643417

Associated revisions

Revision 5bc1116c
Added by Antony Chazapis over 12 years ago

Document django's behavior when using the internal web server and not supplying a Content-Type header.

Fixes #1734

Revision 5bc1116c
Added by Antony Chazapis over 12 years ago

Document django's behavior when using the internal web server and not supplying a Content-Type header.

Fixes #1734

History

#1 Updated by Antony Chazapis over 12 years ago

It has been found that this problem exists only when running django locally with the included web server.

We should find the cause - to see if it can be avoided, or must be documented.

#2 Updated by Antony Chazapis over 12 years ago

The problem is in django/core/servers/basehttp.py, at the following lines:

        if self.headers.typeheader is None:
            env['CONTENT_TYPE'] = self.headers.type
        else:
            env['CONTENT_TYPE'] = self.headers.typeheader

View complete here: https://code.djangoproject.com/browser/django/tags/releases/1.2.3/django/core/servers/basehttp.py#L577

The headers object is of type mimetools.Message - type is by default text/plain (http://docs.python.org/library/mimetools.html#mimetools.Message.gettype).

This issue can not be solved at the application level. We can only document the problem and suggest specifying the Content-Type when issuing a COPY/MOVE at a local server.

#3 Updated by Antony Chazapis over 12 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

#4 Updated by Vangelis Koukis over 11 years ago

  • Project changed from Pithos to Synnefo
  • Target version deleted (0.8.2)

#5 Updated by Vangelis Koukis over 11 years ago

  • Category set to Pithos

Also available in: Atom PDF