NET-A-PORTER / scala-uri

Simple scala library for building and parsing URIs
Other
261 stars 33 forks source link

Uri.parse fails for http://localhost:8080?VkSoj=2Xobp@ #85

Closed sauravshah closed 9 years ago

sauravshah commented 9 years ago

Seems like @ is causing issues. URISyntaxException: : Invalid URI could not be parsed. 1 rule mismatched at error location: uri / | / _abs_uri / optional / _authority / _host_name / oneOrMore / ANY

sauravshah commented 9 years ago

IIUC,

In DefaultUriParser.scala

def _userInfo: Rule1[UserInfo] = rule { capture(oneOrMore(!anyOf(":@") ~ ANY)) ~ optional(":" ~ capture(oneOrMore(!anyOf("@") ~ ANY))) ~ "@" ~> extractUserInfo }

The userInfo rule fires and as a result the uri parsing fails.

sauravshah commented 9 years ago

@theon Please review PR https://github.com/NET-A-PORTER/scala-uri/pull/87

sauravshah commented 9 years ago

@philwill-nap Would you be able to review the PR?

Thanks!

sauravshah commented 9 years ago

PR has been merged. Thanks @theon