Open jomapp opened 1 day ago
Noting that standard java URI supports this.
| Welcome to JShell -- Version 17.0.11
| For an introduction type: /help intro
jshell> var uri = new URI("http://example.com?id=123")
uri ==> http://example.com?id=123
jshell> uri.getPath()
$2 ==> ""
jshell> uri.getQuery()
$3 ==> "id=123"
jshell> uri.getAuthority()
$4 ==> "example.com"
Jetty version(s) 12.0.14
Jetty Environment core
Java version/vendor
(use: java -version)
21.0.2+13-LTSOS type/version Ubuntu 22.04
Description
Parsing an URI with HttpUri.from(String uri) throws an "IllegalArgumentException: Bad authority", when the path is empty (path-empty), but a query is present in the URI. E.g. "http://example.com?id=123". According to https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 an empty path followed by a query section is valid though.
Thanks for looking into this issue!
How to reproduce?
HttpURI.from("http://example.com?id=123")