Wraps Grizzly's HTTP response for Milton.io, applying Kademi's cookie security defaults whenever a cookie is written. Kademi.java creates one instance per outgoing response, wrapping the underlying Grizzly Response. Every cookie set through this class is first passed to CookieManager, which fills in a default SameSite policy and, where the current site requires https, marks the cookie secure, before it is written as a Set-Cookie header. Status and cookie setters are exported for use from GraalJS.

Extends: GrizzlyMiltonResponse


Methods

setCookie(RootFolder rf, Cookie cookie)

Returns: Cookie

Applies Kademi's default cookie security settings for the given root folder and writes the cookie to the response. Delegates to CookieManager.onCookieSet to fill in a default SameSite policy and mark the cookie secure when the site requires https, before adding it via the underlying Grizzly response.

ParameterDescription
rfthe root folder (site) the cookie is being set for, used to decide whether it should be marked secure
cookiethe cookie to write

setStatus(int statusCode)

Returns: void

Sets the HTTP status code of the response, with no status message.

ParameterDescription
statusCodethe HTTP status code to set

setStatus(int statusCode, String statusMessage)

Returns: void

Sets the HTTP status code and status message of the response.

ParameterDescription
statusCodethe HTTP status code to set
statusMessagethe status message text to set, or null to omit it
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.