Author: jim
Date: Fri Sep 3 16:42:10 2010
New Revision: 992366
URL: http://svn.apache.org/viewvc?rev=992366&view=rev
Log:
Bugfix: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38113
Modified:
tomcat/tc5.5.x/trunk/STATUS.txt
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/Request.java
tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
tomcat/tc5.5.x/trunk/container/webapps/docs/config/systemprops.xml
Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL:
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=992366&r1=992365&r2=992366&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Fri Sep 3 16:42:10 2010
@@ -25,16 +25,6 @@ $Id$
PATCHES PROPOSED TO BACKPORT:
[ New proposals should be added at the end of the list ]
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38113
- Add system property to allow spec compliant handling of query string
- http://people.apache.org/~markt/patches/2010-08-25-bug38113.patch
- -1:
- +1: kkolinko jim, rjung, markt: (only with the following trivial change:
- s/Boolean.parseBoolean(..)/Boolean.valueOf(..).booleanValue()/
- because parseBoolean is @since 1.5.
- See Globals.java line 334 for an example.
- )
-
* Remove JSSE13Factory, JSSE13SocketFactory classes,
because
Modified:
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/Request.java
URL:
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/Request.java?rev=992366&r1=992365&r2=992366&view=diff
==============================================================================
---
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/Request.java
(original)
+++
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/Request.java
Fri Sep 3 16:42:10 2010
@@ -84,16 +84,20 @@ import org.apache.catalina.util.StringPa
public class Request
implements HttpServletRequest {
-
- // ----------------------------------------------------------- Constructors
-
+ private final static boolean ALLOW_EMPTY_QUERY_STRING;
static {
// Ensure that classes are loaded for SM
new StringCache.ByteEntry();
new StringCache.CharEntry();
+
+ ALLOW_EMPTY_QUERY_STRING = Boolean.valueOf(System.getProperty(
+
"org.apache.catalina.connector.Request.ALLOW_EMPTY_QUERY_STRING",
+
Boolean.toString(Globals.STRICT_SERVLET_COMPLIANCE))).booleanValue();
}
+
+ // ----------------------------------------------------------- Constructors
public Request() {
formats[0].setTimeZone(GMT_ZONE);
@@ -1900,11 +1904,11 @@ public class Request
*/
public String getQueryString() {
String queryString = coyoteRequest.queryString().toString();
- if (queryString == null || queryString.equals("")) {
- return (null);
- } else {
- return queryString;
+ if (!ALLOW_EMPTY_QUERY_STRING && "".equals(queryString)) {
+ return null;
}
+
+ return queryString;
}
Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=992366&r1=992365&r2=992366&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Fri Sep 3
16:42:10 2010
@@ -38,7 +38,7 @@
<!-- Section names:
General, Catalina, Coyote, Jasper, Cluster, Webapps
-->
-<section name="Tomcat 5.5.31 (XXX)">
+<section name="Tomcat 5.5.31 (jim)">
<subsection name="General">
<changelog>
<fix>
@@ -50,6 +50,10 @@
<subsection name="Catalina">
<changelog>
<fix>
+ <bug>38113</bug> Add system property (ALLOW_EMPTY_QUERY_STRING) to
allow
+ spec compliant handling of query string. (markt/kkolinko/jim)
+ </fix>
+ <fix>
Return a copy of the URL being used from the webapp class loader, not
the original array. (kkolinko/markt)
</fix>
Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/config/systemprops.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/config/systemprops.xml?rev=992366&r1=992365&r2=992366&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/config/systemprops.xml
(original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/config/systemprops.xml Fri Sep
3 16:42:10 2010
@@ -158,6 +158,14 @@
<properties>
+ <property name="org.apache.catalina.
connector.Request.ALLOW_EMPTY_QUERY_STRING">
+ <p>If this is <code>true</code> Tomcat will return an empty string rather
+ than <code>null</code> for empty query strings - i.e. query strings where
+ only <code>?</code> is present. If not specified, the value of
+ <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> will be used
as
+ the default.</p>
+ </property>
+
<property name="org.apache.catalina.SESSION_COOKIE_NAME">
<p>An alternative name for the session cookie. Defaults to
<code>JSESSIONID</code>. Note that the Servlet specification requires
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]