tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1088458 - in /tomcat/trunk: java/org/apache/catalina/connector/Response.java java/org/apache/catalina/valves/AccessLogValve.java webapps/docs/changelog.xml
Date Mon, 04 Apr 2011 00:57:17 GMT
Author: kkolinko
Date: Mon Apr  4 00:57:17 2011
New Revision: 1088458

URL: http://svn.apache.org/viewvc?rev=1088458&view=rev
Log:
Fix display of response headers in AccessLogValve:
1. When no headers are there, display "-" instead of empty string
2. Do not forget "," between multiple values
TC6 already does that but it was broken here in r767956

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/Response.java
    tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=1088458&r1=1088457&r2=1088458&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Mon Apr  4 00:57:17 2011
@@ -913,7 +913,7 @@ public class Response
 
 
     /**
-     * Return an Iterable of all the header values associated with the
+     * Return a Collection of all the header values associated with the
      * specified header name.
      *
      * @param name Header name to look up

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=1088458&r1=1088457&r2=1088458&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Mon Apr  4 00:57:17 2011
@@ -1290,18 +1290,17 @@ public class AccessLogValve extends Valv
         @Override
         public void addElement(StringBuilder buf, Date date, Request request,
                 Response response, long time) {
-           if (null != response) {
+            if (null != response) {
                 Iterator<String> iter = response.getHeaders(header).iterator();
-                boolean first = true;
-                while (iter.hasNext()) {
-                    if (!first) {
-                        buf.append(",");
-                    }
+                if (iter.hasNext()) {
                     buf.append(iter.next());
+                    while (iter.hasNext()) {
+                        buf.append(',').append(iter.next());
+                    }
+                    return;
                 }
-                return ;
             }
-            buf.append("-");
+            buf.append('-');
         }
     }
     

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1088458&r1=1088457&r2=1088458&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Apr  4 00:57:17 2011
@@ -48,6 +48,9 @@
       <fix>
         Correct mix-up in Realm Javadoc. (markt)
       </fix>
+      <fix>
+        Fix display of response headers in AccessLogValve. (kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">



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


Mime
View raw message