mirror of
https://github.com/usememos/memos.git
synced 2025-10-10 22:36:21 +08:00
fix: pdf resource preview (#1008)
This commit is contained in:
parent
42cd93cf33
commit
2d14047c73
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue