Closed onionltd closed 2 years ago
It should be a callback function (IsSafeURL(uri []byte) bool
or some such. More flexible.
It should be a callback function (IsSafeURL(uri []byte) bool or some such. More flexible.
What is the intended behavior? Does the new IsSafeURL
callback overrides internal isSafeLink
? Please elaborate.
Sorry for late response.
Yes, IsSafeURL()
would override isSafeLink
. isSafeLink
could be made public to make things easier for those using IsSafeURL()
Not the right approach.
List of URI schemes is ever growing and instead of hard coding the values, the library should let its users extend the list with whatever values they want. It's only allowed to add to the list (of default values), because I consider the situation where someone doesn't want the default schemes auto-linked as unlikely.
Use of
append
at these particular places may have some impact on performance. I ran the benchmarks but as someone who's not experienced writing benchmarks, I can't be sure. I would appreciate someone's help.