Skip to content
Snippets Groups Projects
Commit e3d981bc authored by Patrick Dowler's avatar Patrick Dowler
Browse files

fix GroupURI to check that scheme is ivo

parent e29bf705
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ sourceCompatibility = 1.7
group = 'org.opencadc'
version = '1.1.3'
version = '1.1.4'
mainClassName = 'ca.nrc.cadc.ac.client.Main'
......
......@@ -99,9 +99,9 @@ public class GroupURI
}
// Ensure the scheme is correct
if (uri.getScheme() == null)
if (uri.getScheme() == null || !"ivo".equals(uri.getScheme()))
{
throw new IllegalArgumentException("GroupURI scheme is required.");
throw new IllegalArgumentException("GroupURI scheme must be 'ivo'.");
}
if (uri.getAuthority() == null)
......
......@@ -37,6 +37,9 @@ public class GroupURITest
{
// no scheme
assertIllegalArgument("example.org/gms?gname", "scheme");
// wrong scheme
assertIllegalArgument("gms://example.org/gms?gname", "scheme");
// no authority
assertIllegalArgument("ivo://gms?gname", "authority");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment