public class AddCookiesToResponseCommand extends AbstractProxyCommand
Command
responsible for copying all the original HTTP response cookies
from the remote content to the internally created HttpResponse
instance.
For example, if it is serving /webcontent2/rproxy/portals/
(where /webcontent2/rproxy
is the concatenation of the servlet context path and the servlet path)
for http://portals.apache.org/
and the remote content sets a cookie with cookie path, /
, then this method should translate the cookie path (/
)
to /webcontent2/rproxy/portals/
in order not to pollute the cookie paths in the single reverse proxy
web application serving multiple remote target web sites.
Constructor and Description |
---|
AddCookiesToResponseCommand() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
executeInternal(ProxyContext context)
Execute a unit of processing work to be performed.
|
protected String |
getReverseCookiePath(ProxyContext context,
org.apache.http.cookie.Cookie responseCookie)
Returns the translated cookie path in the reverse proxy side for the original response cookie.
|
destroy, execute, initialize
protected boolean executeInternal(ProxyContext context) throws ReverseProxyException, IOException
Execute a unit of processing work to be performed. This
AbstractProxyCommand
may either complete the required processing
and return true
, or delegate remaining processing
to the next AbstractProxyCommand
in a ProxyProcessingChain
containing this
AbstractProxyCommand
by returning false
.
executeInternal
in class AbstractProxyCommand
ReverseProxyException
IOException
protected String getReverseCookiePath(ProxyContext context, org.apache.http.cookie.Cookie responseCookie)
For example, if it is serving /webcontent2/rproxy/portals/
(where /webcontent2/rproxy
is the concatenation of the servlet context path and the servlet path)
for http://portals.apache.org/
and the remote content sets a cookie with cookie path, /
, then this method should translate the cookie path (/
)
to /webcontent2/rproxy/portals/
in order not to pollute the cookie paths in the single reverse proxy
web application serving multiple remote target web sites.
context
- responseCookie
- Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.