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:
Tomofumi Tanaka
2014-05-03 00:56:36 +09:00
parent dc21e8388e
commit 619f72d929
3 changed files with 20 additions and 2 deletions

View File

@@ -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
}
})