Lines 18-24
Link Here
|
18 |
|
18 |
|
19 |
package org.apache.catalina.connector; |
19 |
package org.apache.catalina.connector; |
20 |
|
20 |
|
|
|
21 |
import java.util.Arrays; |
21 |
import java.util.HashMap; |
22 |
import java.util.HashMap; |
|
|
23 |
import java.util.HashSet; |
24 |
import java.util.Set; |
22 |
|
25 |
|
23 |
import javax.management.MBeanRegistration; |
26 |
import javax.management.MBeanRegistration; |
24 |
import javax.management.MBeanServer; |
27 |
import javax.management.MBeanServer; |
Lines 44-50
Link Here
|
44 |
|
47 |
|
45 |
|
48 |
|
46 |
/** |
49 |
/** |
47 |
* Implementation of a Coyote connector for Tomcat 5.x. |
50 |
* Implementation of a Coyote connector. |
48 |
* |
51 |
* |
49 |
* @author Craig R. McClanahan |
52 |
* @author Craig R. McClanahan |
50 |
* @author Remy Maucherat |
53 |
* @author Remy Maucherat |
Lines 211-218
Link Here
|
211 |
*/ |
214 |
*/ |
212 |
protected int maxSavePostSize = 4 * 1024; |
215 |
protected int maxSavePostSize = 4 * 1024; |
213 |
|
216 |
|
|
|
217 |
/** |
218 |
* Comma-separated list of HTTP methods that will be parsed according |
219 |
* to POST-style rules for application/x-www-form-urlencoded request bodies. |
220 |
*/ |
221 |
protected String parseBodyMethods = "POST"; |
214 |
|
222 |
|
215 |
/** |
223 |
/** |
|
|
224 |
* A Set of methods determined by {@link #parseBodyMethods}. |
225 |
*/ |
226 |
protected Set<String> parseBodyMethodsSet; |
227 |
|
228 |
|
229 |
/** |
216 |
* Has this component been initialized yet? |
230 |
* Has this component been initialized yet? |
217 |
*/ |
231 |
*/ |
218 |
protected boolean initialized = false; |
232 |
protected boolean initialized = false; |
Lines 617-622
Link Here
|
617 |
} |
631 |
} |
618 |
|
632 |
|
619 |
|
633 |
|
|
|
634 |
public String getParseBodyMethods() { |
635 |
|
636 |
return this.parseBodyMethods; |
637 |
|
638 |
} |
639 |
|
640 |
public void setParseBodyMethods(String methods) { |
641 |
|
642 |
HashSet<String> methodSet = new HashSet<String>(); |
643 |
|
644 |
if( null != methods ) |
645 |
methodSet.addAll(Arrays.asList(methods.split("\\s*,\\s*"))); |
646 |
|
647 |
if( methodSet.contains("TRACE") ) |
648 |
throw new IllegalArgumentException(sm.getString("coyoteConnector.parseBodyMethodNoTrace")); |
649 |
|
650 |
this.parseBodyMethods = methods; |
651 |
this.parseBodyMethodsSet = methodSet; |
652 |
|
653 |
} |
654 |
|
655 |
protected boolean isParseBodyMethod(String method) { |
656 |
|
657 |
return parseBodyMethodsSet.contains(method); |
658 |
|
659 |
} |
660 |
|
620 |
/** |
661 |
/** |
621 |
* Return the port number on which we listen for requests. |
662 |
* Return the port number on which we listen for requests. |
622 |
*/ |
663 |
*/ |
Lines 1071-1076
Link Here
|
1071 |
adapter = new CoyoteAdapter(this); |
1112 |
adapter = new CoyoteAdapter(this); |
1072 |
protocolHandler.setAdapter(adapter); |
1113 |
protocolHandler.setAdapter(adapter); |
1073 |
|
1114 |
|
|
|
1115 |
// Make sure parseBodyMethodsSet has a default |
1116 |
if( null == parseBodyMethodsSet ) |
1117 |
setParseBodyMethods(getParseBodyMethods()); |
1118 |
|
1074 |
IntrospectionUtils.setProperty(protocolHandler, "jkHome", |
1119 |
IntrospectionUtils.setProperty(protocolHandler, "jkHome", |
1075 |
System.getProperty("catalina.base")); |
1120 |
System.getProperty("catalina.base")); |
1076 |
|
1121 |
|