diff options
author | Tulir Asokan <tulir@maunium.net> | 2019-06-16 17:14:51 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2019-06-16 17:14:51 +0300 |
commit | 6eaee844654355d8d5d1dd1710f6c27a47069d0f (patch) | |
tree | 8c5d3374942bf3df7583085714711778d41214fe /matrix | |
parent | 967db3076249902da108b4d9344fb8ed9c221ccc (diff) |
Use https by default if scheme is not provided
Diffstat (limited to 'matrix')
-rw-r--r-- | matrix/matrix.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go index 28eef44..05736ce 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -713,6 +713,9 @@ func (c *Container) Download(mxcURL string) (data []byte, hs, id string, err err func (c *Container) GetDownloadURL(hs, id string) string { dlURL, _ := url.Parse(c.client.HomeserverURL.String()) + if dlURL.Scheme == "" { + dlURL.Scheme = "https" + } dlURL.Path = path.Join(dlURL.Path, "/_matrix/media/v1/download", hs, id) return dlURL.String() } |