Hey guys! When working with http4k, I noticed some...
# http4k
p
Hey guys! When working with http4k, I noticed something that “worried” me a bit. I saw that the class
UriTemplate
was proposing an extension function on
String
called
trimSlashes
. What is the reason to declare an extension function on the class String? This extension function will be accessible anywhere in your code base for any String you want, however it is very clear that it should only be used for `String`s representing URI`s . I was curious behind the reason on declaring it on
String
and not
UriTemplate
for instance.
s
Ouch. That's probably one of the first bits of http4k so I expect to find this kind of rough edges. That should be private, really, as it was not intended to be used outside
UriTemplate
.
p
Ok! I will make a pull request then 😉
s
Excellent 🙂 Thank you for spotting that.
d
Simpler change might just be to make it internal, but whatever works 🙃