fix: pdf resource preview (#1008)

pull/1014/head
Zeng1998 2 years ago committed by GitHub
parent 42cd93cf33
commit 2d14047c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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")

Loading…
Cancel
Save