tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5 CoyoteResponse.java
Date Wed, 04 Sep 2002 23:35:52 GMT

----- Original Message -----
From: <bobh@apache.org>
To: <jakarta-tomcat-connectors-cvs@apache.org>
Sent: Wednesday, September 04, 2002 11:48 AM
Subject: cvs commit:
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5
CoyoteResponse.java


> bobh        2002/09/04 11:48:08
>
>   Modified:    coyote/src/java/org/apache/coyote/tomcat4
>                         CoyoteResponse.java
>                coyote/src/java/org/apache/coyote/tomcat5
>                         CoyoteResponse.java
>   Log:
>    - I noticed that RequestDumperValve was unhappy, so I investigaged and
found
>   that getHeaderValues(String name) was not even using the name parameter.
This
>   fixes that.
>
>   Revision  Changes    Path
>   1.21      +12 -9
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRe
sponse.java
>
>   Index: CoyoteResponse.java
>   ===================================================================
>   RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat
4/CoyoteResponse.java,v
>   retrieving revision 1.20
>   retrieving revision 1.21
>   diff -u -r1.20 -r1.21
>   --- CoyoteResponse.java 4 Aug 2002 19:39:49 -0000 1.20
>   +++ CoyoteResponse.java 4 Sep 2002 18:48:08 -0000 1.21
>   @@ -79,6 +79,7 @@
>    import java.util.Locale;
>    import java.util.Map;
>    import java.util.TimeZone;
>   +import java.util.Vector;
>
>    import javax.servlet.ServletContext;
>    import javax.servlet.ServletException;
>   @@ -789,12 +790,14 @@
>        public String[] getHeaderValues(String name) {
>
>            MimeHeaders headers = coyoteResponse.getMimeHeaders();
>   -        int n = headers.size();
>   -        String[] result = new String[n];
>   -        for (int i = 0; i < n; i++) {
>   -            result[i] = headers.getValue(i).toString();
>   + Vector result = new Vector();
>   +        for (int i = 0; i < headers.size(); i++) {
>   +     if (name.equals( headers.getName(i).toString() ))
>   + result.addElement( headers.getValue(i).toString() );
>            }
>   -        return result;
>   +        String[] resultArray = new String[result.size()];
>   +        result.copyInto(resultArray);
>   +        return resultArray;
>
>        }
>

Headers are case-insensitive, so this still doesn't work.  You're probably
better off using MimeHeaders.values(String).

>
>
>
>   1.5       +12 -9
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRe
sponse.java
>
>   Index: CoyoteResponse.java
>   ===================================================================
>   RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat
5/CoyoteResponse.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- CoyoteResponse.java 13 Aug 2002 20:44:13 -0000 1.4
>   +++ CoyoteResponse.java 4 Sep 2002 18:48:08 -0000 1.5
>   @@ -79,6 +79,7 @@
>    import java.util.Locale;
>    import java.util.Map;
>    import java.util.TimeZone;
>   +import java.util.Vector;
>
>    import javax.servlet.ServletContext;
>    import javax.servlet.ServletException;
>   @@ -814,12 +815,14 @@
>        public String[] getHeaderValues(String name) {
>
>            MimeHeaders headers = coyoteResponse.getMimeHeaders();
>   -        int n = headers.size();
>   -        String[] result = new String[n];
>   -        for (int i = 0; i < n; i++) {
>   -            result[i] = headers.getValue(i).toString();
>   + Vector result = new Vector();
>   +        for (int i = 0; i < headers.size(); i++) {
>   +     if (name.equals( headers.getName(i).toString() ))
>   + result.addElement( headers.getValue(i).toString() );
>            }
>   -        return result;
>   +        String[] resultArray = new String[result.size()];
>   +        result.copyInto(resultArray);
>   +        return resultArray;
>
>        }
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message