Author: sebb
Date: Sat Feb 10 06:11:26 2007
New Revision: 505690

URL: http://svn.apache.org/viewvc?view=rev&rev=505690
Log:
Bug 40383 - only set content-type if not already set
Also apply to file upload. [HttpClient behaves the same way]

Modified:
    
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java?view=diff&rev=505690&r1=505689&r2=505690
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
 Sat Feb 10 06:11:26 2007
@@ -101,8 +101,11 @@
                String filename = sampler.getFilename();
                if ((filename != null) && (filename.trim().length() > 0)) {
                        if (!sampler.getSendFileAsPostBody()) { // unless the 
file is the body...
-                           
connection.setRequestProperty(HTTPSamplerBase.HEADER_CONTENT_TYPE, 
-                    "multipart/form-data; boundary=" + BOUNDARY); // 
$NON-NLS-1$
+                               String hct= 
connection.getRequestProperty(HTTPSamplerBase.HEADER_CONTENT_TYPE);
+                               if (hct == null || hct.length() == 0) {
+                               
connection.setRequestProperty(HTTPSamplerBase.HEADER_CONTENT_TYPE, 
+                        "multipart/form-data; boundary=" + BOUNDARY); // 
$NON-NLS-1$
+                               }
                        }
                        connection.setDoOutput(true);
                        connection.setDoInput(true);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to