Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1963

ContextTest.testForward fails when running with security.manager

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 3.6.1.Final, 4.0.0.Beta5
    • 4.0.0.Beta5
    • jaxrs
    • None
    • Hide

      jdk-10
      resteasy: 4.0.0-SNAPSHOT

      mvn verify -fn \
      -Dsecurity.manager \
      -Dserver.home=/home/rsearls/j1/wfly10/wildfly/dist/target/wildfly-13.0.0.Final \
      -Dmaven.test.redirectTestOutputToFile=false \
      -Dtest=org.jboss.resteasy.test.core.basic.ContextTest

      Show
      jdk-10 resteasy: 4.0.0-SNAPSHOT mvn verify -fn \ -Dsecurity.manager \ -Dserver.home=/home/rsearls/j1/wfly10/wildfly/dist/target/wildfly-13.0.0.Final \ -Dmaven.test.redirectTestOutputToFile=false \ -Dtest=org.jboss.resteasy.test.core.basic.ContextTest

      org.jboss.resteasy.test.core.basic.ContextTest.testForward
      fails when running with security.manager.

      @Path("/")
      public class ContextService {
          @GET
          @Path("/forward")
          public void forward(@Context HttpRequest request) {
              request.forward("/WEB-INF/index.html");
          }
      

      The call, "request.forward" fails.

      When running with the debugger the "request.forward" succeeds.

      The call "request.forward" eventually calls undertow
      io.undertow.servlet.spec.RequestDispatcherImpl.forward

         public void forward(final ServletRequest request, final ServletResponse response) throws ServletException, IOException {
            if (System.getSecurityManager() != null) {
               try {
                  AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                     public Object run() throws Exception {
                        RequestDispatcherImpl.this.forwardImplSetup(request, response);
                        return null;
                     }
                  });
       ....
      

              rsearls r searls
              rsearls r searls
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: