Skip to content

Commit

Permalink
Tracke kall fra pensjonselvbetjening (#6580)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassonav authored Dec 6, 2024
1 parent 7c1663a commit 19880b8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private object UserIdMdcHook : Hook<suspend (ApplicationCall) -> Unit> {
}
}

private val X_NAV_CALL_ID = "x_Nav-Call-Id"
val userIdMdcPlugin: RouteScopedPlugin<PluginConfiguration> =
createRouteScopedPlugin(
name = "UserIdMdcPlugin",
Expand Down Expand Up @@ -81,6 +82,10 @@ val userIdMdcPlugin: RouteScopedPlugin<PluginConfiguration> =
"Ukjent"
}

val callIdOptional = call.request.headers[X_NAV_CALL_ID]
if (callIdOptional != null) {
MDC.put(X_NAV_CALL_ID, callIdOptional)
}
MDC.put(X_USER, user)
call.attributes.put(userAttribute, user)

Expand Down

0 comments on commit 19880b8

Please sign in to comment.