-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Closed
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.com
Description
I've a WebFilter in a functional web app where I want to do the following. Unfortunately, the Javadoc is reminiscent of this, and the more I try, the more I get the application messed up.
- Session management - Create if one doesn't already exist. I'm getting the session out of
ServerWebExchangeand callingisStartedon it - is this the way? - Send redirect without processing rest of the filter chain - I'm setting a
Locationheader in the response and status307, then callingsetComplete, but the desired endpoint is never invoked. - Set request headers - I want to set a request header. Following is how I'm doing it which seems overly complicated for such a simple task.
val modifiedExchange = exchange.mutate().request(
exchange.request.mutate().header(SESSION_ID, sessionId).build())
.build()
.also { it.response.beforeCommit { session.save() } }
chain.filter(modifiedExchange)
1 and 2 are suited for Spring security, but then, I couldn't find any docs for using that with the functional model.
Metadata
Metadata
Assignees
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.com