File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
main/groovy/nextflow/fusion
test/groovy/nextflow/fusion Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,12 @@ class FusionConfig {
46
46
this . enabled = opts. enabled
47
47
this . exportAwsAccessKeys = opts. exportAwsAccessKeys
48
48
this . containerConfigUrl = opts. containerConfigUrl?. toString() ?: env. get(' FUSION_CONTAINER_CONFIG_URL' )
49
- if ( containerConfigUrl && ( ! containerConfigUrl . startsWith( ' http:// ' ) && ! containerConfigUrl. startsWith( ' https:// ' ) ))
49
+ if ( containerConfigUrl && ! validProtocol( containerConfigUrl))
50
50
throw new IllegalArgumentException (" Fusion container config URL should start with 'http:' or 'https:' protocol prefix - offending value: $containerConfigUrl " )
51
51
}
52
52
53
+ protected boolean validProtocol (String url ) {
54
+ url. startsWith(' http://' ) || url. startsWith(' https://' ) || url. startsWith(' file:/' )
55
+ }
56
+
53
57
}
Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ class FusionConfigTest extends Specification {
51
51
OPTS | ENV | EXPECTED
52
52
[:] | [:] | null
53
53
[containerConfigUrl :' http://foo.com' ] | [:] | ' http://foo.com'
54
+ [containerConfigUrl :' https://bar.com' ] | [:] | ' https://bar.com'
55
+ [containerConfigUrl :' file:///some/file' ]| [:] | ' file:///some/file'
54
56
[:] | [FUSION_CONTAINER_CONFIG_URL :' http://bar.com' ] | ' http://bar.com'
55
57
[containerConfigUrl :' http://foo.com' ] | [FUSION_CONTAINER_CONFIG_URL :' http://bar.com' ] | ' http://foo.com'
56
58
You can’t perform that action at this time.
0 commit comments