Author: ron.sigal(a)jboss.com
Date: 2008-03-27 03:28:52 -0400 (Thu, 27 Mar 2008)
New Revision: 3800
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java
Log:
JBREM-934: Put org.apache.tomcat.util.http.MimeHeaders.names() in
AccessController.doPrivileged() call.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java 2008-03-27
07:08:13 UTC (rev 3799)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/CoyoteInvoker.java 2008-03-27
07:28:52 UTC (rev 3800)
@@ -48,11 +48,14 @@
import org.jboss.logging.Logger;
import javax.net.ServerSocketFactory;
+
+import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
@@ -587,8 +590,17 @@
private void populateRequestMetadata(RequestMap metadata, Request req)
{
- MimeHeaders headers = req.getMimeHeaders();
- Enumeration nameEnum = headers.names();
+ final MimeHeaders headers = req.getMimeHeaders();
+ Enumeration nameEnum
+ = (Enumeration)AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return headers.names();
+ }}
+ );
+
+
while (nameEnum.hasMoreElements())
{
Object nameObj = nameEnum.nextElement();