Closed vassilit closed 1 year ago
You're right, let's just use url.JoinPath here; that seems much cleaner, and removes the need for the strings.Suffix!
Yes, but we should modify go.mod also, because url.JoinPath
appeared in Go 1.19.
I guess it could cause issues if the data.urlPath contained extra slashes
if data.urlPath
contain extra slashes right now, this is already a problem, as we don't know how the telegram server will handle ".././../" in URLs. We could use url.PathEscape
on the urlPath part.
Yes, but we should modify go.mod also, because
url.JoinPath
appeared in Go 1.19.
Ahh, thats why. Makes sense, guess we should wait on that for a bit then. Shame.
if
data.urlPath
contain extra slashes right now, this is already a problem, as we don't know how the telegram server will handle ".././../" in URLs. We could useurl.PathEscape
on the urlPath part.
True. Eh, I'm OK with calling that user error. We probably shouldnt mess with that input too much, since itll be used by the user in other places.
Sprintf
should be less efficient thanJoin
, as we are effectively joining two strings by a separator. The «proper» way could have been to use thenet/url
package, butJoin
is simpler.