Skip to content

Commit

Permalink
Update for MSC2702
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Sep 5, 2023
1 parent 77ec235 commit 773b197
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions api/r0/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ func DownloadMedia(r *http.Request, rctx rcontext.RequestContext, user _apimeta.
return _responses.BadRequest("invalid server ID")
}

targetDisposition := r.URL.Query().Get("org.matrix.msc2702.asAttachment")
if targetDisposition == "true" {
targetDisposition = "attachment"
} else if targetDisposition == "false" {
targetDisposition = "inline"
} else {
targetDisposition = "infer"
}

downloadRemote := true
if allowRemote != "" {
parsedFlag, err := strconv.ParseBool(allowRemote)
Expand Down Expand Up @@ -98,6 +89,6 @@ func DownloadMedia(r *http.Request, rctx rcontext.RequestContext, user _apimeta.
Filename: filename,
SizeBytes: media.SizeBytes,
Data: stream,
TargetDisposition: targetDisposition,
TargetDisposition: "infer",
}
}

0 comments on commit 773b197

Please sign in to comment.