mirror of
https://github.com/gin-gonic/gin.git
synced 2025-08-06 15:50:30 +08:00
Simplifies c.File()
This commit is contained in:
@ -375,10 +375,7 @@ func (c *Context) Data(code int, contentType string, data []byte) {
|
||||
|
||||
// Writes the specified file into the body stream
|
||||
func (c *Context) File(filepath string) {
|
||||
c.Render(-1, render.File{
|
||||
Path: filepath,
|
||||
Request: c.Request,
|
||||
})
|
||||
http.ServeFile(c.Writer, c.Request, filepath)
|
||||
}
|
||||
|
||||
func (c *Context) SSEvent(name string, message interface{}) {
|
||||
|
Reference in New Issue
Block a user