You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2007/02/10 13:36:51 UTC

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

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: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org