added in better default checks for content negotiation

pull/630/merge
Justin Richer 2014-07-02 16:01:26 -04:00
parent 3412c1877e
commit 538c4031bb
1 changed files with 6 additions and 2 deletions

View File

@ -105,7 +105,9 @@ public class UserInfoEndpoint {
|| client.getUserInfoEncryptedResponseEnc() != null) { || client.getUserInfoEncryptedResponseEnc() != null) {
// client has a preference, see if they ask for plain JSON specifically on this request // client has a preference, see if they ask for plain JSON specifically on this request
for (MediaType m : mediaTypes) { for (MediaType m : mediaTypes) {
if (!m.isWildcardType() && m.isCompatibleWith(MediaType.APPLICATION_JSON)) { if (!m.isWildcardType() && m.isCompatibleWith(JOSE_MEDIA_TYPE)) {
return "userInfoJwtView";
} else if (!m.isWildcardType() && m.isCompatibleWith(MediaType.APPLICATION_JSON)) {
return "userInfoView"; return "userInfoView";
} }
} }
@ -115,7 +117,9 @@ public class UserInfoEndpoint {
} else { } else {
// client has no preference, see if they asked for JWT specifically on this request // client has no preference, see if they asked for JWT specifically on this request
for (MediaType m : mediaTypes) { for (MediaType m : mediaTypes) {
if (!m.isWildcardType() && m.isCompatibleWith(JOSE_MEDIA_TYPE)) { if (!m.isWildcardType() && m.isCompatibleWith(MediaType.APPLICATION_JSON)) {
return "userInfoView";
} else if (!m.isWildcardType() && m.isCompatibleWith(JOSE_MEDIA_TYPE)) {
return "userInfoJwtView"; return "userInfoJwtView";
} }
} }