Package org.openbravo.base.secureApp
Class AllowedCrossDomainsHandler
- java.lang.Object
-
- org.openbravo.base.secureApp.AllowedCrossDomainsHandler
-
public class AllowedCrossDomainsHandler extends Object
Provides/handles the domain checkers which determine if a specific cross domain request is allowed on the OB server. https://en.wikipedia.org/wiki/Cross-origin_resource_sharing- Author:
- Martin Taal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AllowedCrossDomainsHandler.AllowedCrossDomainsChecker
Implementation provided by modules which determine if a request is coming from an allowed origin.
-
Constructor Summary
Constructors Constructor Description AllowedCrossDomainsHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AllowedCrossDomainsHandler
getInstance()
boolean
isCheckedInvalidOrigin(javax.servlet.http.HttpServletRequest request)
Checks if an origin is set on the header, if not then false is returned.void
setCORSHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Utility method to set CORS headers on a request.static void
setInstance(AllowedCrossDomainsHandler instance)
-
-
-
Method Detail
-
getInstance
public static AllowedCrossDomainsHandler getInstance()
-
setInstance
public static void setInstance(AllowedCrossDomainsHandler instance)
-
isCheckedInvalidOrigin
public boolean isCheckedInvalidOrigin(javax.servlet.http.HttpServletRequest request)
Checks if an origin is set on the header, if not then false is returned. If there are no checkers installed then also false is returned. If there are checkers installed then the origin is checked and the result is returned. Note: will return true if there is indeed an invalid confirmed origin.
-
setCORSHeaders
public void setCORSHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Utility method to set CORS headers on a request.
-
-