File tree Expand file tree Collapse file tree
src/main/java/com/godiddy/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ public Integer call() throws Exception {
5555 }
5656 CLIConfig .setEndpoint (endpoint );
5757 if (this .endpointRaw == null ) {
58+ CLIConfig .setEndpointRaw (null );
5859 System .out .println ("Endpoint successfully set: " + endpoint );
5960 } else {
6061 Boolean endpointRaw = this .endpointRaw ;
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ public void onComplete() { }
104104
105105 private static final Consumer <HttpRequest .Builder > requestInterceptor = builder -> {
106106 Boolean endpointRaw = Endpoint .getEndpointRaw ();
107+ if (endpointRaw == null ) endpointRaw = Endpoint .guessEndpointRaw ();
107108 if (Boolean .TRUE .equals (endpointRaw )) {
108109 String endpointWithSlash = Endpoint .getEndpoint ();
109110 if (! endpointWithSlash .endsWith ("/" )) endpointWithSlash += "/" ;
Original file line number Diff line number Diff line change @@ -45,4 +45,18 @@ public static Boolean getEndpointRaw() {
4545 Boolean endpointRaw = Objects .requireNonNullElse (CLIConfig .getEndpointRaw (), DEFAULT_ENDPOINTRAW );
4646 return endpointRaw ;
4747 }
48+
49+ public static Boolean guessEndpointRaw () {
50+ String endpoint = getEndpoint ();
51+ if (endpoint == null ) return null ;
52+ if (endpoint .contains ("universal-resolver" )) return Boolean .TRUE ;
53+ if (endpoint .contains ("universal-registrar" )) return Boolean .TRUE ;
54+ if (endpoint .contains ("uni-resolver" )) return Boolean .TRUE ;
55+ if (endpoint .contains ("uni-registrar" )) return Boolean .TRUE ;
56+ if (endpoint .contains ("uniresolver.io" )) return Boolean .TRUE ;
57+ if (endpoint .contains ("uniregistrar.io" )) return Boolean .TRUE ;
58+ if (endpoint .contains (":8080" )) return Boolean .TRUE ;
59+ if (endpoint .contains (":9080" )) return Boolean .TRUE ;
60+ return Boolean .FALSE ;
61+ }
4862}
You can’t perform that action at this time.
0 commit comments