Author: sebb
Date: Sat Feb 10 04:36:50 2007
New Revision: 505683

URL: http://svn.apache.org/viewvc?view=rev&rev=505683
Log:
Bug 40383 - only set content-type if not already set

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=505683&r1=505682&r2=505683
==============================================================================
--- 
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 04:36:50 2007
@@ -112,7 +112,10 @@
                else {
                        String postData = sampler.getQueryString();
                        
connection.setRequestProperty(HTTPSamplerBase.HEADER_CONTENT_LENGTH, 
Integer.toString(postData.length()));
-                       
connection.setRequestProperty(HTTPSamplerBase.HEADER_CONTENT_TYPE, 
HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED);
+                       String hct= 
connection.getRequestProperty(HTTPSamplerBase.HEADER_CONTENT_TYPE);
+                       if (hct == null || hct.length() == 0) {
+                           
connection.setRequestProperty(HTTPSamplerBase.HEADER_CONTENT_TYPE, 
HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED);
+                       }
                        connection.setDoOutput(true);
                }
        }



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

Reply via email to