Michael Hayes
04/14/2022, 3:27 PMCorsPolicy(OriginPolicy.AllowAll(), listOf("content-type", "Authorization"), Method.values().toList(), true)
dave
04/14/2022, 5:05 PMMichael Hayes
04/15/2022, 8:52 AMval unsafeGlobalPermissive =
CorsPolicy(OriginPolicy.AllowAll(), listOf("content-type", "Authorization"), Method.values().toList(), true)
val events = defaultEvents()
val apiWithCors = ServerFilters.Cors(unsafeGlobalPermissive)
.then(CatchAll(events))
.then(api)
val poly = PolyHandler(apiWithCors, ws)
poly.asServer(Undertow(port)).start()
Michael Hayes
04/15/2022, 8:52 AMMichael Hayes
04/15/2022, 8:52 AMdave
04/15/2022, 8:53 AMdave
04/15/2022, 8:54 AMMichael Hayes
04/15/2022, 8:54 AMdave
04/15/2022, 8:55 AMdave
04/15/2022, 8:55 AMval fil1 = Filter { next ->
{
next(it)
}
}
val fil2 = Filter { next ->
{
next(it)
}
}
val all: Filter = listOf(fil1, fil2).reduce(Filter::then)
dave
04/15/2022, 8:55 AMMichael Hayes
04/15/2022, 8:55 AM