Merge pull request #3900 from KillerDiller/wellknownprovider-four-oh-four

KEYCLOAK-4519: Avoid NPE for unknown paths under .../.well-known/.
This commit is contained in:
Marek Posolda 2017-03-02 12:22:35 +01:00 committed by GitHub
commit cfb8d25ff2

View file

@ -259,8 +259,13 @@ public class RealmsResource {
WellKnownProvider wellKnown = session.getProvider(WellKnownProvider.class, providerName);
ResponseBuilder responseBuilder = Response.ok(wellKnown.getConfig()).cacheControl(CacheControlUtil.getDefaultCacheControl());
return Cors.add(request, responseBuilder).allowedOrigins("*").auth().build();
if (wellKnown != null) {
ResponseBuilder responseBuilder = Response.ok(wellKnown.getConfig())
.cacheControl(CacheControlUtil.getDefaultCacheControl());
return Cors.add(request, responseBuilder).allowedOrigins("*").auth().build();
}
throw new NotFoundException();
}
@Path("{realm}/authz")