Commit cf9becf1 authored by bmajor's avatar bmajor Committed by GitHub
Browse files

Merge pull request #22 from pdowler/master

fix GroupURI to check that scheme is ivo
parents e29bf705 e3d981bc
......@@ -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");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment