Open CrowdHailer opened 1 month ago
I think you're correct @CrowdHailer -- https://developer.mozilla.org/en-US/docs/Web/API/URL/origin
This is easy to reproduce too:
import gleam/io
import gleam/uri
pub fn main() {
let url = "https://gleam.run/"
let assert Ok(uri) = uri.parse(url)
let assert Ok(origin) = uri.origin(uri)
io.println(origin)
}
Results in:
https://gleam.run/
When it should be:
https://gleam.run
Thank you
https://github.com/gleam-lang/stdlib/blob/v0.38.0/test/gleam/uri_test.gleam#L409-L425
I think these tests are wrong in that the origin should be
http://example.test
(without trailing slash)`. The examples in the function documentation show it without a slash