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 | |
parent | 967db3076249902da108b4d9344fb8ed9c221ccc (diff) |
Use https by default if scheme is not provided
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | matrix/matrix.go | 3 |
3 files changed, 6 insertions, 1 deletions
@@ -25,7 +25,7 @@ require ( gopkg.in/russross/blackfriday.v2 v2.0.1 gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 gopkg.in/yaml.v2 v2.2.2 - maunium.net/go/mautrix v0.1.0-alpha.3.0.20190616122434-35971ee5ad3c + maunium.net/go/mautrix v0.1.0-alpha.3.0.20190616140407-62f6f484857e maunium.net/go/mauview v0.0.0-20190606152754-de9e0a754a5d maunium.net/go/tcell v0.0.0-20190606152714-9a88fc07b3ed ) @@ -94,6 +94,8 @@ gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= maunium.net/go/mautrix v0.1.0-alpha.3.0.20190616122434-35971ee5ad3c h1:FxaOZhImKcBiGI/IqPlMnzweKuUxXQCGP8B/p0nJw1k= maunium.net/go/mautrix v0.1.0-alpha.3.0.20190616122434-35971ee5ad3c/go.mod h1:O+QWJP3H7BZEzIBSrECKpnpRnEKBwaoWVEu/yZwVwxg= +maunium.net/go/mautrix v0.1.0-alpha.3.0.20190616140407-62f6f484857e h1:W3NG02SHY4ldbLFyr0vQugKJQdONOb1lEjBPd3PTCrk= +maunium.net/go/mautrix v0.1.0-alpha.3.0.20190616140407-62f6f484857e/go.mod h1:O+QWJP3H7BZEzIBSrECKpnpRnEKBwaoWVEu/yZwVwxg= maunium.net/go/mauview v0.0.0-20190606152754-de9e0a754a5d h1:H4wZ4vMVnOh5QFsb4xZtssgpv3DDEkBRzQ8iyEg2fX0= maunium.net/go/mauview v0.0.0-20190606152754-de9e0a754a5d/go.mod h1:GL+akv58wNFzzX4IKLvryKx0F/AcYKHql35DiBzBc/w= maunium.net/go/tcell v0.0.0-20190606152714-9a88fc07b3ed h1:sAcUrUZG2LFWBTkTtLKPQvHPHFM5d6huAhr5ZZuxtbQ= 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() } |