From 98ef88b6689bf52c96deb51ed057829465c76279 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Fri, 26 May 2017 14:59:45 +0200 Subject: [PATCH] mediaapi/writers/download: Clarify validation applied to Origin --- src/github.com/matrix-org/dendrite/mediaapi/writers/download.go | 2 ++ 1 file changed, 2 insertions(+) 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 7e52ec51..1d1097d4 100644 --- a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go +++ b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go @@ -91,6 +91,8 @@ func (r *downloadRequest) Validate() *util.JSONResponse { JSON: jsonerror.NotFound(fmt.Sprintf("mediaId must be a non-empty string using only characters in %v", mediaIDCharacters)), } } + // Note: the origin will be validated either by comparison to the configured server name of this homeserver + // or by a DNS SRV record lookup when creating a request for remote files if r.MediaMetadata.Origin == "" { return &util.JSONResponse{ Code: 404,