Open dannywillems opened 8 years ago
That's probably OK. The http://
or https://
is optional, and q7fPbXDbpCLdP5acC7WfCTmeYr2QFnglLhjgCPrYfd
looks like a valid hostname without a port and path (both optional). Do you have an example that is definitely not a URL?
May be a good way is to replace Url
by ocaml-uri
- but, yes lot of works :( ?
We need to intervene in the Url
module (sooner rather than later) to get rid of the Ocamlnet dependency (Netstring_pcre
). It may well be the case that ocaml-uri
is all we need.
Yes, I know this problem :) . I can try to replace Url_base
and Url
by ocaml-uri
and keep the same interface - to keep the compatibility with Eliom - if you want. But ocaml-uri
adds some dependencies (like re
, sexplib
and stringext
). And I think, @balat does not want that - but, may be, I'm wrong.
@vasilisp I retried and the function doesn't terminate (I added a print before and after and the after is not printed). I found the issue when I was sending a random string representing a state (in OAuth2) instead of the redirect URL.
When sending a random string (for example q7fPbXDbpCLdP5acC7WfCTmeYr2QFnglLhjgCPrYfd), Ocsigen_lib.Url.parse doesn't fail and says nothing.
It would be better to throw an exception in this case.