public class InvalidRequestFilter extends AccessControlFilter
This filter checks and blocks the request if the following characters are found in the request URI:
blockSemicolon = falseblockBackslash = falseblockNonAscii = false, the ability to disable this check will be removed in future version.blockTraversal = falseDEFAULT_LOGIN_URL, GET_METHOD, POST_METHODappliedPaths, pathMatcherALREADY_FILTERED_SUFFIXfilterConfig| Constructor and Description |
|---|
InvalidRequestFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isAccessAllowed(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse response,
Object mappedValue)
Returns
true if the request is allowed to proceed through the filter normally, or false
if the request should be handled by the
onAccessDenied(request,response,mappedValue)
method instead. |
boolean |
isBlockBackslash() |
boolean |
isBlockEncodedForwardSlash() |
boolean |
isBlockEncodedPeriod() |
boolean |
isBlockNonAscii() |
boolean |
isBlockRewriteTraversal() |
boolean |
isBlockSemicolon() |
boolean |
isBlockTraversal() |
protected boolean |
onAccessDenied(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Processes requests where the subject was denied access as determined by the
isAccessAllowed
method. |
void |
setBlockBackslash(boolean blockBackslash) |
void |
setBlockEncodedForwardSlash(boolean blockEncodedForwardSlash) |
void |
setBlockEncodedPeriod(boolean blockEncodedPeriod) |
void |
setBlockNonAscii(boolean blockNonAscii) |
void |
setBlockRewriteTraversal(boolean blockRewriteTraversal) |
void |
setBlockSemicolon(boolean blockSemicolon) |
void |
setBlockTraversal(boolean blockTraversal) |
getLoginUrl, getSubject, isLoginRequest, onAccessDenied, onPreHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin, setLoginUrlgetPathWithinApplication, isEnabled, pathsMatch, pathsMatch, preHandle, processPathConfigafterCompletion, cleanup, doFilterInternal, executeChain, postHandledoFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, isFilterOncePerRequest, setEnabled, setFilterOncePerRequest, shouldNotFiltergetName, setName, toStringBuilderdestroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfiggetContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toStringprotected boolean isAccessAllowed(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse response,
Object mappedValue)
throws Exception
AccessControlFiltertrue if the request is allowed to proceed through the filter normally, or false
if the request should be handled by the
onAccessDenied(request,response,mappedValue)
method instead.isAccessAllowed in class AccessControlFilterreq - the incoming ServletRequestresponse - the outgoing ServletResponsemappedValue - the filter-specific config value mapped to this filter in the URL rules mappings.true if the request should proceed through the filter normally, false if the
request should be processed by this filter's
AccessControlFilter.onAccessDenied(ServletRequest,ServletResponse,Object) method instead.Exception - if an error occurs during processing.protected boolean onAccessDenied(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws Exception
AccessControlFilterisAccessAllowed
method.onAccessDenied in class AccessControlFilterrequest - the incoming ServletRequestresponse - the outgoing ServletResponsetrue if the request should continue to be processed; false if the subclass will
handle/render the response directly.Exception - if there is an error processing the request.public boolean isBlockSemicolon()
public void setBlockSemicolon(boolean blockSemicolon)
public boolean isBlockBackslash()
public void setBlockBackslash(boolean blockBackslash)
public boolean isBlockNonAscii()
public void setBlockNonAscii(boolean blockNonAscii)
public boolean isBlockTraversal()
public void setBlockTraversal(boolean blockTraversal)
public boolean isBlockEncodedPeriod()
public void setBlockEncodedPeriod(boolean blockEncodedPeriod)
public boolean isBlockEncodedForwardSlash()
public void setBlockEncodedForwardSlash(boolean blockEncodedForwardSlash)
public boolean isBlockRewriteTraversal()
public void setBlockRewriteTraversal(boolean blockRewriteTraversal)
Copyright © 2004–2023 The Apache Software Foundation. All rights reserved.