Author: remy.maucherat(a)jboss.com
Date: 2008-12-29 06:38:59 -0500 (Mon, 29 Dec 2008)
New Revision: 884
Modified:
trunk/java/org/apache/coyote/http11/Http11Processor.java
Log:
- Date format security cleanup.
Modified: trunk/java/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-12-23 14:30:48 UTC (rev
883)
+++ trunk/java/org/apache/coyote/http11/Http11Processor.java 2008-12-29 11:38:59 UTC (rev
884)
@@ -21,8 +21,6 @@
import java.io.InterruptedIOException;
import java.net.InetAddress;
import java.net.Socket;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -73,7 +71,7 @@
protected static StringManager sm =
StringManager.getManager(Constants.Package);
-
+
// ------------------------------------------------------------ Constructor
@@ -96,6 +94,9 @@
// Cause loading of HexUtils
int foo = HexUtils.DEC[0];
+ // Cause loading of FastHttpDateFormat
+ FastHttpDateFormat.getCurrentDate();
+
}
@@ -1529,19 +1530,7 @@
}
// Add date header
- String date = null;
- if (org.apache.coyote.Constants.IS_SECURITY_ENABLED){
- date = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
- public String run(){
- return FastHttpDateFormat.getCurrentDate();
- }
- }
- );
- } else {
- date = FastHttpDateFormat.getCurrentDate();
- }
- headers.setValue("Date").setString(date);
+
headers.setValue("Date").setString(FastHttpDateFormat.getCurrentDate());
// FIXME: Add transfer encoding header
Show replies by date