aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-04-28 16:22:14 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-04-28 16:57:12 +0800
commit79e83b3550bcaa3da0fa86da8925d2f1347a5e2b (patch)
tree0d65cc1bc5f3552113f2557b21536aa4d75c9299
parentb4159c4ce6a5fd66ba407fd3ed42daa25a839ffa (diff)
Fix RANGE to HTTP_RANGE in request.META
It should be HTTP_RANGE in META, most params will be changed to format of HTTP_* in headers. Issue-ID: VFC-1367 Change-Id: If9afff6ab124ff1ed0c978f26542b63585126fd7 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
-rw-r--r--catalog/packages/tests/test_ns_descriptor.py2
-rw-r--r--catalog/packages/tests/test_vnf_package.py2
-rw-r--r--catalog/packages/views/ns_descriptor_views.py2
-rw-r--r--catalog/packages/views/vnf_package_views.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/catalog/packages/tests/test_ns_descriptor.py b/catalog/packages/tests/test_ns_descriptor.py
index f26ec394..d156843a 100644
--- a/catalog/packages/tests/test_ns_descriptor.py
+++ b/catalog/packages/tests/test_ns_descriptor.py
@@ -248,7 +248,7 @@ class TestNsDescriptor(TestCase):
response = self.client.get(
"/api/nsd/v1/ns_descriptors/23/nsd_content",
- RANGE='5-10',
+ HTTP_RANGE='5-10',
format='json'
)
partial_file_content = ''
diff --git a/catalog/packages/tests/test_vnf_package.py b/catalog/packages/tests/test_vnf_package.py
index e83aa7a3..9f0cef51 100644
--- a/catalog/packages/tests/test_vnf_package.py
+++ b/catalog/packages/tests/test_vnf_package.py
@@ -250,7 +250,7 @@ class TestVnfPackage(TestCase):
onboardingState="ONBOARDED",
localFilePath="vnfPackage.csar"
)
- response = self.client.get("/api/vnfpkgm/v1/vnf_packages/222/package_content", RANGE="4-7")
+ response = self.client.get("/api/vnfpkgm/v1/vnf_packages/222/package_content", HTTP_RANGE="4-7")
partial_file_content = ''
for data in response.streaming_content:
partial_file_content = partial_file_content + data
diff --git a/catalog/packages/views/ns_descriptor_views.py b/catalog/packages/views/ns_descriptor_views.py
index 81836d35..73388ee4 100644
--- a/catalog/packages/views/ns_descriptor_views.py
+++ b/catalog/packages/views/ns_descriptor_views.py
@@ -134,6 +134,6 @@ def nsd_content_ru(request, **kwargs):
raise e
if request.method == 'GET':
- file_range = request.META.get('RANGE')
+ file_range = request.META.get('HTTP_RANGE')
file_iterator = NsDescriptor().download(nsd_info_id, file_range)
return StreamingHttpResponse(file_iterator, status=status.HTTP_200_OK)
diff --git a/catalog/packages/views/vnf_package_views.py b/catalog/packages/views/vnf_package_views.py
index 094b6f59..dcff9867 100644
--- a/catalog/packages/views/vnf_package_views.py
+++ b/catalog/packages/views/vnf_package_views.py
@@ -105,7 +105,7 @@ def package_content_ru(request, **kwargs):
raise e
if request.method == "GET":
- file_range = request.META.get('RANGE')
+ file_range = request.META.get('HTTP_RANGE')
file_iterator = VnfPackage().download(vnf_pkg_id, file_range)
return StreamingHttpResponse(file_iterator, status=status.HTTP_200_OK)