Skip to content

Parsing URI with HttpUri.from(String uri) throws "IllegalArgumentException: Bad authority" when path is empty #12404

@jomapp

Description

@jomapp

Jetty version(s)
12.0.14

Jetty Environment
core

Java version/vendor (use: java -version)
21.0.2+13-LTS

OS 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?

  • Run HttpURI.from("http://example.com?id=123")
  • See error

Metadata

Metadata

Assignees

Labels

BugFor general bugs on Jetty side

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions