Avoid NPE for unknown paths under .../.well-known/.

This commit is contained in:
Stefan Paletta 2017-02-27 02:42:02 +01:00
parent 07f99a946d
commit bcbde3fdf0

View file

@ -259,10 +259,15 @@ public class RealmsResource {
WellKnownProvider wellKnown = session.getProvider(WellKnownProvider.class, providerName);
ResponseBuilder responseBuilder = Response.ok(wellKnown.getConfig()).cacheControl(CacheControlUtil.getDefaultCacheControl());
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")
public Object getAuthorizationService(@PathParam("realm") String name) {
ProfileHelper.requireFeature(Profile.Feature.AUTHORIZATION);