diff --git a/README.rst b/README.rst index 5a1c642..2e7a7b3 100644 --- a/README.rst +++ b/README.rst @@ -118,12 +118,17 @@ Add any of these variables into your project settings to override them. * Function used to encode response data. Receives a dict and returns a string * Default: ``DjangoJSONEncoder().encode`` -``CHUNKED_UPLOAD_MIMETYPE`` +``CHUNKED_UPLOAD_CONTENT_TYPE`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* Mimetype for the response data. +* Content-Type for the response data. * Default: ``'application/json'`` +``CHUNKED_UPLOAD_MIMETYPE`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* **Deprecated**, use ``CHUNKED_UPLOAD_CONTENT_TYPE`` instead. + ``CHUNKED_UPLOAD_MAX_BYTES`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/VERSION.txt b/VERSION.txt index e6d5cb8..e4c0d46 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -1.0.2 \ No newline at end of file +1.0.3 \ No newline at end of file diff --git a/chunked_upload/response.py b/chunked_upload/response.py index 4da9898..22eb7b9 100644 --- a/chunked_upload/response.py +++ b/chunked_upload/response.py @@ -1,6 +1,6 @@ from django.http import HttpResponse -from .settings import ENCODER, MIMETYPE +from .settings import ENCODER, CONTENT_TYPE class Response(HttpResponse): @@ -10,7 +10,7 @@ class Response(HttpResponse): def __init__(self, content, status=None, *args, **kwargs): super(Response, self).__init__( content=ENCODER(content), - mimetype=MIMETYPE, + content_type=CONTENT_TYPE, status=status, *args, **kwargs ) diff --git a/chunked_upload/settings.py b/chunked_upload/settings.py index cd3572f..70f995d 100644 --- a/chunked_upload/settings.py +++ b/chunked_upload/settings.py @@ -38,9 +38,15 @@ ENCODER = getattr(settings, 'CHUNKED_UPLOAD_ENCODER', DEFAULT_ENCODER) -# Mimetype for the response data -DEFAULT_MIMETYPE = 'application/json' -MIMETYPE = getattr(settings, 'CHUNKED_UPLOAD_MIMETYPE', DEFAULT_MIMETYPE) +# Content-Type for the response data +DEFAULT_CONTENT_TYPE = 'application/json' +CONTENT_TYPE = getattr(settings, 'CHUNKED_UPLOAD_CONTENT_TYPE', + DEFAULT_CONTENT_TYPE) + + +# CHUNKED_UPLOAD_MIMETYPE is deprecated, but kept for backward compatibility +CONTENT_TYPE = getattr(settings, 'CHUNKED_UPLOAD_MIMETYPE', + DEFAULT_CONTENT_TYPE) # Max amount of data (in bytes) that can be uploaded. `None` means no limit