jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

When producing URI/URL strings follow spec and produce lowercase schemes and drop default ports

Open joakime opened this issue 1 year ago • 0 comments

Jetty version(s) 12.0.6

Jetty Environment All

Java version/vendor (use: java -version) Any

OS type/version Any

Description The URI spec says that we should accept form of case when we read a scheme, but should produce lowercase schemes.

  • https://datatracker.ietf.org/doc/html/rfc3986#section-3.1

The spec also says that the port is optional, and the scheme specific specs for HTTP and websocket says similar things.

URI Specs

  • https://datatracker.ietf.org/doc/html/rfc3986#section-3.2
  • https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3

HTTP/HTTPS scheme specific specs

  • https://www.rfc-editor.org/rfc/rfc8615.html#section-3
  • https://www.rfc-editor.org/rfc/rfc9110.html#name-http-uri-scheme
  • https://www.rfc-editor.org/rfc/rfc9110.html#name-https-uri-scheme
  • https://www.rfc-editor.org/rfc/rfc9110.html#name-https-normalization-and-com

Websocket scheme specific specs

  • https://www.rfc-editor.org/rfc/rfc8307.html
  • https://www.rfc-editor.org/rfc/rfc6455.html#section-1.1
  • https://www.rfc-editor.org/rfc/rfc6455.html#section-1.7

We should strive to produce proper URIs where we can.

joakime avatar Feb 16 '24 11:02 joakime