aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2019-04-28 09:25:15 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-28 09:25:15 +0000
commitd226459b9097574cd5d521a243aafc902393bd76 (patch)
treeda28255c79d55be6e9a7657c96ec49fcc5a1f096
parentd3ca942ebfd2834a83ba5823b9314b716ba31099 (diff)
parent79e83b3550bcaa3da0fa86da8925d2f1347a5e2b (diff)
Merge "Fix RANGE to HTTP_RANGE in request.META"
-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)