fix(handlers): use http.ServeFile for better static file serving
Replace echo's c.File() with standard library http.ServeFile() in the ServeFile handler. This provides more reliable static file serving and better handles edge cases in file delivery.
This commit is contained in:
@@ -1549,5 +1549,6 @@ func (mh *MediaHandler) ServeFile(c *echo.Context) error {
|
||||
|
||||
c.Response().Header().Set("Content-Type", contentType)
|
||||
c.Response().Header().Set("Cache-Control", "public, max-age=86400")
|
||||
return c.File(fullPath)
|
||||
http.ServeFile(c.Response(), c.Request(), fullPath)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user