HHH-15322 Allow JNDI lookups using the osgi scheme
This commit is contained in:
parent
1b60e350c4
commit
20b9d99a18
|
@ -116,7 +116,7 @@ final class JndiServiceImpl implements JndiService {
|
|||
try {
|
||||
final URI uri = new URI( jndiName );
|
||||
final String scheme = uri.getScheme();
|
||||
if ( scheme != null && (! "java".equals( scheme ) ) ) {
|
||||
if ( scheme != null && (! allowedScheme( scheme ) ) ) {
|
||||
throw new JndiException( "JNDI lookups for scheme '" + scheme + "' are not allowed" );
|
||||
}
|
||||
}
|
||||
|
@ -134,6 +134,16 @@ final class JndiServiceImpl implements JndiService {
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean allowedScheme(final String scheme) {
|
||||
switch ( scheme ) {
|
||||
case "java" :
|
||||
case "osgi" :
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanUp(InitialContext initialContext) {
|
||||
try {
|
||||
initialContext.close();
|
||||
|
|
Loading…
Reference in New Issue