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.commain
parent
da0dd06475
commit
69f8d5a77e
|
@ -305,6 +305,10 @@ func (r *downloadRequest) respondFromLocalFile(
|
||||||
}).Info("Responding with file")
|
}).Info("Responding with file")
|
||||||
responseFile = file
|
responseFile = file
|
||||||
responseMetadata = r.MediaMetadata
|
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))
|
w.Header().Set("Content-Type", string(responseMetadata.ContentType))
|
||||||
|
|
Loading…
Reference in New Issue