Package org.apache.catalina.filters
Class RemoteIpFilter.XForwardedRequest
java.lang.Object
javax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
org.apache.catalina.filters.RemoteIpFilter.XForwardedRequest
- All Implemented Interfaces:
HttpServletRequest
,ServletRequest
- Enclosing class:
- RemoteIpFilter
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected int
protected String
protected String
protected String
protected boolean
protected String
protected int
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
getDateHeader
(String name) The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.The default behavior of this method is to return getHeader(String name) on the wrapped request object.getHeaderEntry
(String name) The default behavior of this method is to return getHeaderNames() on the wrapped request object.getHeaders
(String name) The default behavior of this method is to return getHeaders(String name) on the wrapped request object.int
getIntHeader
(String name) The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.The default behavior of this method is to return getLocalName() on the wrapped request object.int
The default behavior of this method is to return getLocalPort() on the wrapped request object.The default behavior of this method is to return getRemoteAddr() on the wrapped request object.The default behavior of this method is to return getRemoteHost() on the wrapped request object.The default behavior of this method is to return getRequestURL() on the wrapped request object.The default behavior of this method is to return getScheme() on the wrapped request object.The default behavior of this method is to return getServerName() on the wrapped request object.int
The default behavior of this method is to return getServerPort() on the wrapped request object.Obtain a builder for generating push requests.void
removeHeader
(String name) void
void
setLocalName
(String localName) void
setLocalPort
(int localPort) void
setRemoteAddr
(String remoteAddr) void
setRemoteHost
(String remoteHost) void
void
setSecure
(boolean secure) void
setServerName
(String serverName) void
setServerPort
(int serverPort) Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getHttpServletMapping, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, upgrade
Methods inherited from class javax.servlet.ServletRequestWrapper
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemotePort, getRequest, getRequestDispatcher, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemotePort, getRequestDispatcher, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
-
Field Details
-
headers
-
localName
-
localPort
protected int localPort -
remoteAddr
-
remoteHost
-
scheme
-
secure
protected boolean secure -
serverName
-
serverPort
protected int serverPort
-
-
Constructor Details
-
XForwardedRequest
-
-
Method Details
-
getDateHeader
Description copied from class:javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.- Specified by:
getDateHeader
in interfaceHttpServletRequest
- Overrides:
getDateHeader
in classHttpServletRequestWrapper
- Parameters:
name
- aString
specifying the name of the header- Returns:
- a
long
value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the request
-
getHeader
Description copied from class:javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getHeader(String name) on the wrapped request object.- Specified by:
getHeader
in interfaceHttpServletRequest
- Overrides:
getHeader
in classHttpServletRequestWrapper
- Parameters:
name
- aString
specifying the header name- Returns:
- a
String
containing the value of the requested header, ornull
if the request does not have a header of that name
-
getHeaderEntry
-
getHeaderNames
Description copied from class:javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getHeaderNames() on the wrapped request object.- Specified by:
getHeaderNames
in interfaceHttpServletRequest
- Overrides:
getHeaderNames
in classHttpServletRequestWrapper
- Returns:
- an enumeration of all the header names sent with this request; if the request has no headers, an empty
enumeration; if the servlet container does not allow servlets to use this method,
null
-
getHeaders
Description copied from class:javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getHeaders(String name) on the wrapped request object.- Specified by:
getHeaders
in interfaceHttpServletRequest
- Overrides:
getHeaders
in classHttpServletRequestWrapper
- Parameters:
name
- aString
specifying the header name- Returns:
- an
Enumeration
containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null
-
getIntHeader
Description copied from class:javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.- Specified by:
getIntHeader
in interfaceHttpServletRequest
- Overrides:
getIntHeader
in classHttpServletRequestWrapper
- Parameters:
name
- aString
specifying the name of a request header- Returns:
- an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
-
getLocalName
Description copied from class:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getLocalName() on the wrapped request object.- Specified by:
getLocalName
in interfaceServletRequest
- Overrides:
getLocalName
in classServletRequestWrapper
- Returns:
- a
String
containing the host name of the IP on which the request was received.
-
getLocalPort
public int getLocalPort()Description copied from class:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getLocalPort() on the wrapped request object.- Specified by:
getLocalPort
in interfaceServletRequest
- Overrides:
getLocalPort
in classServletRequestWrapper
- Returns:
- an integer specifying the port number
-
getRemoteAddr
Description copied from class:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getRemoteAddr() on the wrapped request object.- Specified by:
getRemoteAddr
in interfaceServletRequest
- Overrides:
getRemoteAddr
in classServletRequestWrapper
- Returns:
- a
String
containing the IP address of the client that sent the request
-
getRemoteHost
Description copied from class:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getRemoteHost() on the wrapped request object.- Specified by:
getRemoteHost
in interfaceServletRequest
- Overrides:
getRemoteHost
in classServletRequestWrapper
- Returns:
- a
String
containing the fully qualified name of the client
-
getScheme
Description copied from class:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getScheme() on the wrapped request object.- Specified by:
getScheme
in interfaceServletRequest
- Overrides:
getScheme
in classServletRequestWrapper
- Returns:
- a
String
containing the name of the scheme used to make this request
-
getServerName
Description copied from class:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getServerName() on the wrapped request object.- Specified by:
getServerName
in interfaceServletRequest
- Overrides:
getServerName
in classServletRequestWrapper
- Returns:
- a
String
containing the name of the server
-
getServerPort
public int getServerPort()Description copied from class:javax.servlet.ServletRequestWrapper
The default behavior of this method is to return getServerPort() on the wrapped request object.- Specified by:
getServerPort
in interfaceServletRequest
- Overrides:
getServerPort
in classServletRequestWrapper
- Returns:
- an integer specifying the port number
-
removeHeader
-
setHeader
-
setLocalName
-
setLocalPort
public void setLocalPort(int localPort) -
setRemoteAddr
-
setRemoteHost
-
setScheme
-
setSecure
public void setSecure(boolean secure) -
setServerName
-
setServerPort
public void setServerPort(int serverPort) -
getRequestURL
Description copied from class:javax.servlet.http.HttpServletRequestWrapper
The default behavior of this method is to return getRequestURL() on the wrapped request object.- Specified by:
getRequestURL
in interfaceHttpServletRequest
- Overrides:
getRequestURL
in classHttpServletRequestWrapper
- Returns:
- a
StringBuffer
object containing the reconstructed URL
-
newPushBuilder
Description copied from class:javax.servlet.http.HttpServletRequestWrapper
Obtain a builder for generating push requests.PushBuilder
documents how this request will be used as the basis for a push request. Each call to this method will return a new instance, independent of any previous instance obtained.The default behavior of this method is to return
HttpServletRequest.newPushBuilder()
on the wrapped request object.- Specified by:
newPushBuilder
in interfaceHttpServletRequest
- Overrides:
newPushBuilder
in classHttpServletRequestWrapper
- Returns:
- A builder that can be used to generate push requests based on this request or
null
if push is not supported. Note that even if a PushBuilder instance is returned, by the time thatPushBuilder.push()
is called, it may no longer be valid to push a request and the push request will be ignored.
-