Unverified Commit 2d14047c authored by Zeng1998's avatar Zeng1998 Committed by GitHub

fix: pdf resource preview (#1008)

parent 42cd93cf
...@@ -300,7 +300,7 @@ func (s *Server) registerResourcePublicRoutes(g *echo.Group) { ...@@ -300,7 +300,7 @@ func (s *Server) registerResourcePublicRoutes(g *echo.Group) {
} }
resourceType := strings.ToLower(resource.Type) resourceType := strings.ToLower(resource.Type)
if strings.HasPrefix(resourceType, "text") || strings.HasPrefix(resourceType, "application") { if strings.HasPrefix(resourceType, "text") || (strings.HasPrefix(resourceType, "application") && resourceType != "application/pdf") {
resourceType = echo.MIMETextPlain resourceType = echo.MIMETextPlain
} }
c.Response().Writer.Header().Set(echo.HeaderCacheControl, "max-age=31536000, immutable") c.Response().Writer.Header().Set(echo.HeaderCacheControl, "max-age=31536000, immutable")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment