You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started looking into this and noticed a couple of things with the js impl: it's using a variation of this regex ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? provided in the Uri rfc. However this will behave differently from the implementation for the Erlang target (done by uri_string:parse); for example :wibble is rejected on the Erlang target but is parsed as a uri with path ":wibble" on the js one
I'm pretty sure it's the Erlang implementation that is correct here since that regex is only meant to "break down a well-formed URI reference into its components". In any way it would be best if both targets behaved the same here.
If the plan is to get rid of the regex dependency to v1 stdlib as soon as possible I can go ahead and implement a parser equivalent to that regex, it would take very little time but the target differences would still be there!
Or since we're making this change we could try and copy Erlang's implementation but that would be a big item of work (the erlang implementation is thousands of lines of code from what I can tell and understanding it and porting it to Gleam could require a long time)
Convert it to manually parse the URI instead.
The text was updated successfully, but these errors were encountered: