linkedin / URL-Detector

A Java library to detect and normalize URLs in text
783 stars 186 forks source link

Default Scheme on url with no scheme #14

Open davidthemarsh opened 7 years ago

davidthemarsh commented 7 years ago

When parsing a URL like "linkedin.com", the url object will add a default scheme of 'http' if one is not detected: URL.getScheme()

I can understand why some defaults were included but it would be nice if this behavior could be configured. I need to know whether the original input text contained the scheme.

I can always do something like url.getOriginalUrl().startsWith(url.getScheme()) but I don't want to have to do that everywhere.