From 2d822c57f986a054baf7bfaa76bd14ca5a862b5f Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Thu, 1 Jun 2017 15:30:36 +0200 Subject: [PATCH] mediaapi/writers/download: Use DNS address as not all HSes have SRV --- .../matrix-org/dendrite/mediaapi/writers/download.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go index c320e512..c13e52e3 100644 --- a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go +++ b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go @@ -25,7 +25,6 @@ import ( "path/filepath" "regexp" "strconv" - "strings" "sync" log "github.com/Sirupsen/logrus" @@ -431,7 +430,7 @@ func (r *downloadRequest) createRemoteRequest() (*http.Response, *util.JSONRespo resErr := jsonerror.InternalServerError() return nil, &resErr } - url := "https://" + strings.Trim(dnsResult.SRVRecords[0].Target, ".") + ":" + strconv.Itoa(int(dnsResult.SRVRecords[0].Port)) + url := "https://" + dnsResult.Addrs[0] r.Logger.WithField("URL", url).Info("Connecting to remote")