mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-08 18:16:59 +00:00
Content-Disposition HTTP header in mediaapi's responses added (#685)
This should fix #628 I also Noticed that GET /_matrix/media/r0/download/{serverName}/{mediaId}/{fileName} is not yet implemented, but it should work for both. Signed-off-by: Kouamé Behouba Manassé behouba@gmail.com
This commit is contained in:
parent
da0dd06475
commit
69f8d5a77e
@ -305,6 +305,10 @@ func (r *downloadRequest) respondFromLocalFile(
|
||||
}).Info("Responding with file")
|
||||
responseFile = file
|
||||
responseMetadata = r.MediaMetadata
|
||||
|
||||
if len(responseMetadata.UploadName) > 0 {
|
||||
w.Header().Set("Content-Disposition", fmt.Sprintf(`inline; filename*=utf-8"%s"`, responseMetadata.UploadName))
|
||||
}
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", string(responseMetadata.ContentType))
|
||||
|
Loading…
Reference in New Issue
Block a user