fix: pdf resource preview (#1008)

This commit is contained in:
Zeng1998
2023-02-02 20:34:24 +08:00
committed by GitHub
parent 42cd93cf33
commit 2d14047c73

View File

@ -300,7 +300,7 @@ func (s *Server) registerResourcePublicRoutes(g *echo.Group) {
}
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
}
c.Response().Writer.Header().Set(echo.HeaderCacheControl, "max-age=31536000, immutable")