Package com.hexagonkt.http.server.callbacks

Utility callbacks that can be used on handlers. Reuse a callback in different handlers (after, filter, etc.).


Link copied to clipboard
class CorsCallback(    allowedOrigin: Regex,     allowedMethods: Set<HttpMethod> = ALL,     allowedHeaders: Set<String> = emptySet(),     exposedHeaders: Set<String> = emptySet(),     supportCredentials: Boolean = true,     preFlightStatus: SuccessStatus = NO_CONTENT,     preFlightMaxAge: Long = 0) : Function1<HttpServerContext, HttpServerContext>

HTTP CORS callback. It holds info for CORS.

Link copied to clipboard
class FileCallback(file: File) : Function1<HttpServerContext, HttpServerContext>

Callback that resolves requests' path parameters to files based on a base file. Requests path parameters are not allowed to contain .. (references to file parent directories are not permitted).

Link copied to clipboard
class UrlCallback(url: URL) : Function1<HttpServerContext, HttpServerContext>