mirror of
https://github.com/labstack/echo.git
synced 2025-12-01 22:51:17 +02:00
Inline feature (#637)
This commit is contained in:
committed by
Vishal Rana
parent
6fd725c953
commit
8a85626a71
@@ -145,6 +145,19 @@ func TestContext(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Inline
|
||||
rec = test.NewResponseRecorder()
|
||||
c = e.NewContext(req, rec).(*echoContext)
|
||||
file, err = os.Open("_fixture/images/walle.png")
|
||||
if assert.NoError(t, err) {
|
||||
err = c.Inline(file, "walle.png")
|
||||
if assert.NoError(t, err) {
|
||||
assert.Equal(t, http.StatusOK, rec.Status())
|
||||
assert.Equal(t, "inline; filename=walle.png", rec.Header().Get(HeaderContentDisposition))
|
||||
assert.Equal(t, 219885, rec.Body.Len())
|
||||
}
|
||||
}
|
||||
|
||||
// NoContent
|
||||
rec = test.NewResponseRecorder()
|
||||
c = e.NewContext(req, rec).(*echoContext)
|
||||
|
||||
Reference in New Issue
Block a user