Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: pdf resource preview (#1008)

Zeng19982d14047c73aa
diff --git a/server/resource.go b/server/resource.go
index 579ec7b57..0a2a889b8 100644
--- a/server/resource.go
+++ b/server/resource.go
@@ -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")