incorrect publicSuffix matching
Closed this issue · 5 comments
brahn commented
It would appear that publicSuffix will match as much of the ending of the url's host as possible, regardless of whether that match is a complete set of hostParts.
Examples:
scala> import com.netaporter.uri.Uri
scala> Uri.parse("http://www.foo.com").publicSuffix
res1: Option[String] = Some(com)
// correct result
scala> Uri.parse("http://www.bar.com").publicSuffix
res2: Option[String] = Some(ar.com)
// incorrect result, should have returned `Some(com)`
scala> Uri.parse("http://www.bar.com").publicSuffixes
res2: Option[String] = List(ar.com, com, om)
// incorrect result, should have returned `List(com)`
theon commented
Thanks! Good catch. Fixed and released in 0.4.13
brahn commented
Wow that was fast. Thank you!!
brahn commented
(Mind pinging me when pushed to http://mvnrepository.com/artifact/com.netaporter/scala-uri_2.11 ?)
theon commented
It should be there now @brahn. Let me know if you still can't get it.
I think it takes a little time for oss.sonatype.org to sync to maven central.
brahn commented
Works like a charm. Thanks again!