Allow markdown files to read from the LFS (#5787)

This PR makes it possible for the markdown renderer to render images and media straight from the LFS.

Fix #5746

Signed-off-by: Andrew Thornton [art27@cantab.net](mailto:art27@cantab.net)
This commit is contained in:
zeripath 2019-02-12 15:09:43 +00:00 committed by GitHub
parent 296814e887
commit 2a03e96bce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 339 additions and 45 deletions

View file

@ -22,3 +22,15 @@ func TestDownloadByID(t *testing.T) {
assert.Equal(t, "# repo1\n\nDescription for repo1", resp.Body.String())
}
func TestDownloadByIDMedia(t *testing.T) {
prepareTestEnv(t)
session := loginUser(t, "user2")
// Request raw blob
req := NewRequest(t, "GET", "/user2/repo1/media/blob/4b4851ad51df6a7d9f25c979345979eaeb5b349f")
resp := session.MakeRequest(t, req, http.StatusOK)
assert.Equal(t, "# repo1\n\nDescription for repo1", resp.Body.String())
}