Class SecurityExchange
java.lang.Object
com.codename1.backend.security.SecurityExchange
What a chain keeps about the request the calling thread is serving, beyond the request itself: attributes filters hand one another, and headers for the response that is yet to come back.
A SecurityFilter does not write into the response it gets from the rest of
the chain, because a handler may answer every request with one shared
object. It records the header here instead, and the server writes it into
its own copy of the response:
SecurityExchange.current().setResponseHeader("X-Request-Trace", id);
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponseHeader(String name, String value) Adds a header to the response this request will get, beside any other of that name: one moreSet-Cookie.static SecurityExchangecurrent()The exchange of the request this thread is serving under a chain, or null when it serves none.getAttribute(String name) Something an earlier filter recorded undername, or null.The chain guarding the request.booleanisSecure()Whether the request arrived over TLS: terminated by this server, or by a proxy it trusts; seeHttpServer.Request.isSecure().voidsetAttribute(String name, Object value) Recordsvaluefor later filters and for the handler; null removes it.voidsetResponseHeader(String name, String value) Sets a header on the response this request will get, replacing one the handler set under the same name.
-
Method Details
-
current
The exchange of the request this thread is serving under a chain, or null when it serves none. -
getRequest
-
isSecure
public boolean isSecure()Whether the request arrived over TLS: terminated by this server, or by a proxy it trusts; seeHttpServer.Request.isSecure(). -
getFilterChain
The chain guarding the request. -
getAttribute
-
setAttribute
-
setResponseHeader
-
addResponseHeader
-