<@U0GCNKJF4> we're looking at this now - I've spik...
# http4k
@pabl0rg we're looking at this now - I've spiked out a solution for this using Lenses. Here's the current version of how it might look:
Copy code
fun main(args: Array<String>) {

    val contexts = RequestContexts()

    val key = RequestContextKey.of<String>(contexts)
    val key2 = RequestContextKey.of<String>(contexts)

    fun AddStringTo(key: RequestContextLens<String>) = Filter { next ->
            next(it.with(key of "hello", key2 of "bob"))

    val next: HttpHandler = { request ->
        Response(Status.OK).body(key.extract(request) + key2.extract(request))

    val b = ServerFilters.InitialiseRequestContext(contexts)

    val a = b(Request(Method.GET, "/hello"))
. The
is an object which is shared globally across the app. You also need to add the InitialiseRequestContext filter to the chain, which deals with cleaning up the RequestContext at the end.