mirror of
				https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
				synced 2025-11-04 12:38:02 +00:00 
			
		
		
		
	Net: near complete merge to 1.4.2
This commit is contained in:
		@@ -126,13 +126,15 @@ void HTMLFormTest::testWriteMultipart()
 | 
			
		||||
	form.set("field1", "value1");
 | 
			
		||||
	form.set("field2", "value 2");
 | 
			
		||||
	form.set("field3", "value=3");
 | 
			
		||||
	form.set("field4", "value&4");
 | 
			
		||||
	
 | 
			
		||||
	form.addPart("attachment1", new StringPartSource("This is an attachment"));
 | 
			
		||||
	form.addPart("attachment2", new StringPartSource("This is another attachment", "text/plain", "att2.txt"));
 | 
			
		||||
	
 | 
			
		||||
	std::ostringstream ostr;
 | 
			
		||||
	form.write(ostr, "MIME_boundary_0123456789");
 | 
			
		||||
        form.set("field4", "value&4");
 | 
			
		||||
        
 | 
			
		||||
        form.addPart("attachment1", new StringPartSource("This is an attachment"));
 | 
			
		||||
        StringPartSource* pSPS = new StringPartSource("This is another attachment", "text/plain", "att2.txt");
 | 
			
		||||
        pSPS->headers().set("Content-ID", "1234abcd");
 | 
			
		||||
        form.addPart("attachment2", pSPS);
 | 
			
		||||
        
 | 
			
		||||
        std::ostringstream ostr;
 | 
			
		||||
        form.write(ostr, "MIME_boundary_0123456789");
 | 
			
		||||
	std::string s = ostr.str();
 | 
			
		||||
	assert (s == 
 | 
			
		||||
		"--MIME_boundary_0123456789\r\n"
 | 
			
		||||
@@ -149,18 +151,19 @@ void HTMLFormTest::testWriteMultipart()
 | 
			
		||||
		"value=3\r\n"
 | 
			
		||||
		"--MIME_boundary_0123456789\r\n"
 | 
			
		||||
		"Content-Disposition: form-data; name=\"field4\"\r\n"
 | 
			
		||||
		"\r\n"
 | 
			
		||||
		"value&4\r\n"
 | 
			
		||||
		"--MIME_boundary_0123456789\r\n"
 | 
			
		||||
		"Content-Disposition: file; name=\"attachment1\"\r\n"
 | 
			
		||||
		"Content-Type: text/plain\r\n"
 | 
			
		||||
		"\r\n"
 | 
			
		||||
		"This is an attachment\r\n"
 | 
			
		||||
		"--MIME_boundary_0123456789\r\n"
 | 
			
		||||
		"Content-Disposition: file; name=\"attachment2\"; filename=\"att2.txt\"\r\n"
 | 
			
		||||
		"Content-Type: text/plain\r\n"
 | 
			
		||||
		"\r\n"
 | 
			
		||||
		"This is another attachment\r\n"
 | 
			
		||||
                "\r\n"
 | 
			
		||||
                "value&4\r\n"
 | 
			
		||||
                "--MIME_boundary_0123456789\r\n"
 | 
			
		||||
                "Content-Disposition: form-data; name=\"attachment1\"\r\n"
 | 
			
		||||
                "Content-Type: text/plain\r\n"
 | 
			
		||||
                "\r\n"
 | 
			
		||||
                "This is an attachment\r\n"
 | 
			
		||||
                "--MIME_boundary_0123456789\r\n"
 | 
			
		||||
                "Content-Disposition: form-data; name=\"attachment2\"; filename=\"att2.txt\"\r\n"
 | 
			
		||||
                "Content-ID: 1234abcd\r\n"
 | 
			
		||||
                "Content-Type: text/plain\r\n"
 | 
			
		||||
                "\r\n"
 | 
			
		||||
                "This is another attachment\r\n"
 | 
			
		||||
		"--MIME_boundary_0123456789--\r\n"
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user