From 9f8c82a2320557d6576a262a6bb56b8b2205eb40 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 25 Sep 2019 19:20:35 +0200 Subject: [PATCH] #128 accept header is a space separated array --- .../forwardauth/infrastructure/spring/AuthorizeController.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/dniel/forwardauth/infrastructure/spring/AuthorizeController.kt b/src/main/kotlin/dniel/forwardauth/infrastructure/spring/AuthorizeController.kt index c73e3b25..74bf3d90 100644 --- a/src/main/kotlin/dniel/forwardauth/infrastructure/spring/AuthorizeController.kt +++ b/src/main/kotlin/dniel/forwardauth/infrastructure/spring/AuthorizeController.kt @@ -61,7 +61,7 @@ class AuthorizeController(val authorizeHandler: AuthorizeHandler) { it is AuthorizeHandler.AuthEvent.NeedRedirectEvent } as AuthorizeHandler.AuthEvent.NeedRedirectEvent? if (redirectEvent != null) { - if ((acceptContent != null && acceptContent == "application/json") || + if ((acceptContent != null && acceptContent.contains("application/json")) || requestedWithHeader != null && requestedWithHeader == "XMLHttpRequest") { return ResponseEntity.status(HttpStatus.FORBIDDEN).build() } else {