Replaced calls to HttpServletRequest.getScheme(),HttpServletRequest.host() and HttpServletRequest.getPathInfo() with a call to HttpServletRequest.getServletURL()
Calls to HttpServletRequest.getPathInfo() return null if extra path information is unavailable causing malformed URLs to be returned.