You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by du...@apache.org on 2001/06/25 23:54:23 UTC
cvs commit: xml-soap/java/src/org/apache/soap/util/net HTTPUtils.java
duftler 01/06/25 14:54:22
Modified: java/src/org/apache/soap/util/net HTTPUtils.java
Log:
A StringOutOfBoundsException was being thrown when a server returned a
header with no value to an Apache SOAP client. Thanks to
markh@vcitysoftware.com for raising this issue. See
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2221 for the details.
Revision Changes Path
1.21 +4 -2 xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java
Index: HTTPUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- HTTPUtils.java 2001/05/19 17:17:14 1.20
+++ HTTPUtils.java 2001/06/25 21:54:19 1.21
@@ -285,8 +285,10 @@
String name = namebuf.toString();
// Remove trailing ; to prevent ContextType from throwing exception
- if (valuebuf.charAt(valuebuf.length()-1) == ';') {
- valuebuf.deleteCharAt(valuebuf.length()-1);
+ int valueLen = valuebuf.length();
+
+ if (valueLen > 0 && valuebuf.charAt(valueLen - 1) == ';') {
+ valuebuf.deleteCharAt(valueLen - 1);
}
String value = valuebuf.toString();