Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-433

libcloud throws an exception when content-type is not supplied and it cannot guess the content type successfully

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.13.2
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
      None

      Description

      Whenever uploading a file using libcloud, it will throw an exception if there is no content-type specified and it cannot guess the content-type from the file extension.

      Somewhere along the line of django-randomfilenamestorage, django-storages and libcloud (I suspect in django-storages), the content-type of the file will be stripped if the browser passes a content-type on an uploaded file of application/octet-stream.

      When this lands in libcloud.storage.base.StorageDriver._upload_object, libcloud attempts to guess the file's content-type from it's extension if none is supplied. When this fails, an AttributeError is raised.

      Instead of throwing an exception, why not send the content-type of unknown bytestreams: application/octet-stream.

      Patch is incoming.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              micolous Michael Farrell
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: