protected String getPathWithinApplication(ServletRequest request) {
        return WebUtils.getPathWithinApplication(WebUtils.toHttp(request));
    }
Returns the context path within the application based on the specified <code>request</code>.
<p/>
This implementation merely delegates to
{@link WebUtils#getPathWithinApplication(javax.servlet.http.HttpServletRequest)
     WebUtils.getPathWithinApplication(request)},
but can be overridden by subclasses for custom logic.

@param request the incoming <code>ServletRequest</code>
@return the context path within the application.
web/src/main/java/org/apache/shiro/web/filter/PathMatchingFilter.java