diff --git a/src/main/scala/gitbucket/core/controller/ApiController.scala b/src/main/scala/gitbucket/core/controller/ApiController.scala index 248f74b..d118fa4 100644 --- a/src/main/scala/gitbucket/core/controller/ApiController.scala +++ b/src/main/scala/gitbucket/core/controller/ApiController.scala @@ -133,9 +133,12 @@ val largeFile = params.get("large_file").exists(s => s.equals("true")) val content = getContentFromId(git, f.id, largeFile) request.getHeader("Accept") match { - case "application/vnd.github.v3.raw" => + case "application/vnd.github.v3.raw" => { + contentType = "application/vnd.github.v3.raw" content - case "application/vnd.github.v3.html" if isRenderable(f.name) => + } + case "application/vnd.github.v3.html" if isRenderable(f.name) => { + contentType = "application/vnd.github.v3.html" content.map(c => List( "
", "
", @@ -143,7 +146,9 @@ "
", "
" ).mkString ) - case "application/vnd.github.v3.html" => + } + case "application/vnd.github.v3.html" => { + contentType = "application/vnd.github.v3.html" content.map(c => List( "
", "
", "
",
@@ -151,6 +156,7 @@
                   "
", "
", "
" ).mkString ) + } case _ => Some(JsonFormat(ApiContents(f, content))) }