Package com.microstrategy.utils
Class HttpUtils
- java.lang.Object
 - 
- com.microstrategy.utils.HttpUtils
 
 
- 
public class HttpUtils extends java.lang.ObjectThis class provides static utility methods to eliminate Web Veracode false alarm for CWE ID 113 Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting').- Since:
 - MicroStrategy Web 11.3.1
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static intMAX_COOKIES_IN_REQUESTstatic intMAX_HEADERS_IN_REQUESTstatic intMAX_PARAMETERS_IN_REQUEST 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddCookie(javax.servlet.http.HttpServletResponse response, javax.servlet.http.Cookie cookie)The default behavior of this method is to call addCookie(Cookie cookie)static voidaddHeader(javax.servlet.http.HttpServletResponse response, java.lang.String name, java.lang.String value)The default behavior of this method is to return addHeader(String name, String value)static booleanis2xxSuccessful(int statusCode)Whether this status code is in the range of 2xxstatic voidsendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String location)The default behavior of this method is to return sendRedirect(String location)static voidsetContentType(javax.servlet.ServletResponse response, java.lang.String type)Sets the content type of the response being sent to the clientstatic voidsetHeader(javax.servlet.http.HttpServletResponse response, java.lang.String name, java.lang.String value)The default behavior of this method is to return setHeader(String name, String value) 
 - 
 
- 
- 
Field Detail
- 
MAX_COOKIES_IN_REQUEST
public static final int MAX_COOKIES_IN_REQUEST
- See Also:
 - Constant Field Values
 
 
- 
MAX_HEADERS_IN_REQUEST
public static final int MAX_HEADERS_IN_REQUEST
- See Also:
 - Constant Field Values
 
 
- 
MAX_PARAMETERS_IN_REQUEST
public static final int MAX_PARAMETERS_IN_REQUEST
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
sendRedirect
public static void sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String location) throws java.io.IOExceptionThe default behavior of this method is to return sendRedirect(String location)- Parameters:
 response- HttpServletResponselocation- the redirect location URL- Throws:
 java.io.IOException- If an input or output exception occurs
 
- 
setHeader
public static void setHeader(javax.servlet.http.HttpServletResponse response, java.lang.String name, java.lang.String value)The default behavior of this method is to return setHeader(String name, String value)- Parameters:
 response- HttpServletResponsename- the name of the headervalue- the header value If it contains octet string
 
- 
addHeader
public static void addHeader(javax.servlet.http.HttpServletResponse response, java.lang.String name, java.lang.String value)The default behavior of this method is to return addHeader(String name, String value)- Parameters:
 response- HttpServletResponsename- the name of the headervalue- the header value If it contains octet string
 
- 
addCookie
public static void addCookie(javax.servlet.http.HttpServletResponse response, javax.servlet.http.Cookie cookie)The default behavior of this method is to call addCookie(Cookie cookie)- Parameters:
 response- HttpServletResponsecookie- the Cookie to return to the client
 
- 
setContentType
public static void setContentType(javax.servlet.ServletResponse response, java.lang.String type)Sets the content type of the response being sent to the client- Parameters:
 response- ServletResponsetype- aStringspecifying the MIME type of the content
 
- 
is2xxSuccessful
public static boolean is2xxSuccessful(int statusCode)
Whether this status code is in the range of 2xx- Parameters:
 statusCode-- Returns:
 - true if statusCode is in the range of 2xx
 
 
 - 
 
 -