mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 20:15:59 +01:00
Add link for image file
* Render image tag with link tag on issue and wiki * Correct response content-type of attached image on issue
This commit is contained in:
@@ -275,7 +275,10 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
|
||||
get("/:owner/:repository/_attached/:file")(referrersOnly { repository =>
|
||||
defining(new java.io.File(Directory.getAttachedDir(repository.owner, repository.name), params("file"))){ file =>
|
||||
if(file.exists) file else NotFound
|
||||
if(file.exists) {
|
||||
contentType = FileUtil.getMimeType(file)
|
||||
file
|
||||
} else NotFound
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user