Remove debug headers and return 403 on access denied
All checks were successful
build-and-deploy / build-deploy (push) Successful in 26s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 26s
This commit is contained in:
@@ -26,12 +26,8 @@ class SecurityConfig(
|
||||
}
|
||||
.exceptionHandling {
|
||||
it.authenticationEntryPoint(HttpStatusEntryPoint(HttpStatus.UNAUTHORIZED))
|
||||
it.accessDeniedHandler { request, response, ex ->
|
||||
if (request.getHeader("X-Debug-Auth") == "1") {
|
||||
val msg = ex.message?.take(200) ?: "access_denied"
|
||||
response.setHeader("X-Access-Debug", msg)
|
||||
}
|
||||
response.sendError(HttpStatus.UNAUTHORIZED.value(), "Unauthorized")
|
||||
it.accessDeniedHandler { _, response, _ ->
|
||||
response.sendError(HttpStatus.FORBIDDEN.value(), "Forbidden")
|
||||
}
|
||||
}
|
||||
.httpBasic { it.disable() }
|
||||
|
||||
Reference in New Issue
Block a user