Previously, the discovery endpoint always used HTTPS due to relying on SWD.url_builder, which in turn used URI::HTTPS to build the URI, supporting only the HTTPS scheme. This change enables HTTP URLs to work correctly by using URI::Generic.build instead, preserving the original scheme.
Store the original scheme from the input URI.
Use URI::Generic.build instead of SWD.url_builder/URI::HTTPS.
Previously, the discovery endpoint always used HTTPS due to relying on
SWD.url_builder
, which in turn usedURI::HTTPS
to build the URI, supporting only the HTTPS scheme. This change enables HTTP URLs to work correctly by usingURI::Generic.build
instead, preserving the original scheme.URI::Generic.build
instead ofSWD.url_builder/URI::HTTPS
.