[java-identity-provider COMMIT] in /trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate: WebflowR...

noreply at shibboleth.net noreply at shibboleth.net
Mon Apr 1 17:13:20 EDT 2013


Author: scantor
Date: Mon Apr  1 17:13:20 2013
New Revision: 4379

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4379&view=rev
Log:
Guard servlet object access for non-web use.

Modified:
    trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletRequestLookup.java
    trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletResponseLookup.java

Modified: trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletRequestLookup.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletRequestLookup.java?rev=4379&r1=4378&r2=4379&view=diff
==============================================================================
--- trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletRequestLookup.java (original)
+++ trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletRequestLookup.java Mon Apr  1 17:13:20 2013
@@ -43,7 +43,11 @@
             log.debug("Webflow RequestContext's ExternalContext was null");
             return null;
         }
-
-        return (HttpServletRequest) externalContext.getNativeRequest();
+        
+        if (externalContext.getNativeRequest() instanceof HttpServletRequest) {
+            return (HttpServletRequest) externalContext.getNativeRequest();
+        }
+        
+        return null;
     }
 }

Modified: trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletResponseLookup.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletResponseLookup.java?rev=4379&r1=4378&r2=4379&view=diff
==============================================================================
--- trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletResponseLookup.java (original)
+++ trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/navigate/WebflowRequestContextHttpServletResponseLookup.java Mon Apr  1 17:13:20 2013
@@ -45,6 +45,10 @@
             return null;
         }
 
-        return (HttpServletResponse) externalContext.getNativeResponse();
+        if (externalContext.getNativeResponse() instanceof HttpServletResponse) {
+            return (HttpServletResponse) externalContext.getNativeResponse();
+        }
+        
+        return null;
     }
 }



More information about the commits mailing list