From 3391ec5377b5f2204dab2c14b38893e0e3556628 Mon Sep 17 00:00:00 2001 From: Samuel Ueltschi Date: Wed, 9 May 2018 12:47:14 +0200 Subject: [PATCH] check if content-type is null when restoring request --- .../java/org/keycloak/adapters/servlet/FilterSessionStore.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java b/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java index 243ab3353d..1589ac1468 100755 --- a/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java +++ b/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java @@ -111,8 +111,7 @@ public class FilterSessionStore implements AdapterSessionStore { if (body == null) return new MultivaluedHashMap(); String contentType = getContentType(); - contentType = contentType.toLowerCase(); - if (contentType.startsWith("application/x-www-form-urlencoded")) { + if (contentType != null && contentType.toLowerCase().startsWith("application/x-www-form-urlencoded")) { ByteArrayInputStream is = new ByteArrayInputStream(body); try { parameters = parseForm(is);