Skip to content

Instantly share code, notes, and snippets.

@spencergibb
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spencergibb/ced5199c80f7a6c89499 to your computer and use it in GitHub Desktop.
Save spencergibb/ced5199c80f7a6c89499 to your computer and use it in GitHub Desktop.
underscores in domains and java's URI class
import java.net.URI;
public class Test {
public static void main(String[] args) {
String r = "http://user:password@foo_bar:8761/eureka/apps";
URI uri = URI.create(r);
System.out.println(uri.getHost());
// prints null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment