mauz555, [tantek], [Rose], [prtksxna], [jgmac1106], janttoDiscord[m], willibuddyDiscor, [KevinMarks], [grantcodes], IWSlackGateway and [jgarber] joined the channel
#[jgarber]☝ Important difference being the trailing slash in the normalized URL.
#aaronpkIf you want the URL to represent a document fetched from that address then yes it needs the slash, because you can't make an HTTP request with no path
#[jgarber]> return the normalized absolute URL of the gotten value, following the containing document’s language’s rules for resolving relative URLs (e.g. in HTML, use the current URL context as determined by the page, and first <base> element, if any).
#[jgarber]…and I’m wondering if that’s accurate or if the “normalized absolute URL of the gotten value” in the text above is being misinterpreted in examples, parsers, etc.
#aaronpkHm I don't know what the intent is there. It'd certainly be easier for me to consume if the parser added the slash. I have code that does that in most of my projects
#sknebelonly doing url parsing if it is looking at relative stuff
#sknebel(url parsing is also not the fastest thing to do, but I don't remember numbers)
#[jgarber]The Ruby microformats parser does not and the generic microformats test suite follows the wiki (which does not add trailing slash in the examples).
[tantek], [KevinMarks], [Lewis_Cowles], [mapkyca], [fluffy] and [jgarber] joined the channel
#[jgarber]I’m partial to “normalized absolute URL” including the trailing slash when the URL is of kind `https://example.com`.
#aaronpki'm trying to imagine a situation in which that would cause errors, but I can't think of any
#[jgarber]Real world _probably_ wouldn’t cause errors.
#[jgarber]We’d need to update the wiki, the test suite, and parsers may need updating, though.
#sknebelalthough real-world situations where not having it causes errors likely are also fairly rare - and you have to expect weird output from the parsers, since they'll pass through unfixable inputs - at least that was the answer last time "how to handle an unparsable URL" was raised
#aaronpki'm thinking things like URL comparisons for representative h-card and such
#aaronpkand those all need to be normalized to include the / when comparing anyway
#[jgarber]Right. The IndieAuth spec, when defining profile URLs, etc., clearly states that the trailing slash (in this precise example) constitutes a valid profile URL (whereas a URL lacking the trailing slash _does not_).
#[jgarber]☝ If we’re looking for other similar documented cases.
#[jgarber]If there’s enough consensus, I’m happy to open up a PR on the microformats/tests suite that adds the necessary slashes in the expected output JSON (while intentionally _not_ updating the input HTML). Not sure I’d be able to update all the pages on the wiki, though. 😂
[tonz], kev1, [aarongustafson], [tantek], [Lewis_Cowles], [jgarber], [jgmac1106], [manton], [Rose] and [KevinMarks] joined the channel