Merge "Fix response of Upload Part Copy requests"
This commit is contained in:
		
							
								
								
									
										5
									
								
								doc/rnc/copy_part_result.rnc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								doc/rnc/copy_part_result.rnc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| start = | ||||
|   element CopyPartResult { | ||||
|     element LastModified { xsd:dateTime }, | ||||
|     element ETag { xsd:string } | ||||
|   } | ||||
| @@ -114,7 +114,7 @@ class PartController(Controller): | ||||
|         resp = req.get_response(self.app) | ||||
|  | ||||
|         if 'X-Amz-Copy-Source' in req.headers: | ||||
|             resp.append_copy_resp_body() | ||||
|             resp.append_copy_resp_body(req.controller_name) | ||||
|  | ||||
|         resp.status = 200 | ||||
|         return resp | ||||
|   | ||||
| @@ -96,7 +96,7 @@ class ObjectController(Controller): | ||||
|         resp = req.get_response(self.app) | ||||
|  | ||||
|         if 'X-Amz-Copy-Source' in req.headers: | ||||
|             resp.append_copy_resp_body() | ||||
|             resp.append_copy_resp_body(req.controller_name) | ||||
|  | ||||
|         resp.status = HTTP_OK | ||||
|         return resp | ||||
|   | ||||
| @@ -135,8 +135,8 @@ class Response(ResponseBase, swob.Response): | ||||
|  | ||||
|         return resp | ||||
|  | ||||
|     def append_copy_resp_body(self): | ||||
|         elem = Element('CopyObjectResult') | ||||
|     def append_copy_resp_body(self, controller_name): | ||||
|         elem = Element('Copy%sResult' % controller_name) | ||||
|         SubElement(elem, 'LastModified').text = \ | ||||
|             self.last_modified.isoformat()[:-6] + '.000Z' | ||||
|         SubElement(elem, 'ETag').text = '"%s"' % self.etag | ||||
|   | ||||
							
								
								
									
										13
									
								
								swift3/schema/copy_part_result.rng
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								swift3/schema/copy_part_result.rng
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> | ||||
|   <start> | ||||
|     <element name="CopyPartResult"> | ||||
|       <element name="LastModified"> | ||||
|         <data type="dateTime"/> | ||||
|       </element> | ||||
|       <element name="ETag"> | ||||
|         <data type="string"/> | ||||
|       </element> | ||||
|     </element> | ||||
|   </start> | ||||
| </grammar> | ||||
| @@ -751,7 +751,7 @@ class TestSwift3MultiUpload(Swift3TestCase): | ||||
|         self.assertEquals(status.split()[0], '200') | ||||
|         self.assertEquals(headers['Content-Type'], 'application/xml') | ||||
|         self.assertTrue(headers.get('etag') is None) | ||||
|         elem = fromstring(body, 'CopyObjectResult') | ||||
|         elem = fromstring(body, 'CopyPartResult') | ||||
|         self.assertEquals(elem.find('LastModified').text, iso_format) | ||||
|         self.assertEquals(elem.find('ETag').text, '"%s"' % self.etag) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jenkins
					Jenkins