mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve kernel HTTP panic recover Fix https://github.com/siyuan-note/siyuan/issues/7888
This commit is contained in:
parent
0d832cc97e
commit
813de05019
2 changed files with 30 additions and 3 deletions
|
@ -51,9 +51,12 @@ func Serve(fastMode bool) {
|
|||
gin.SetMode(gin.ReleaseMode)
|
||||
ginServer := gin.New()
|
||||
ginServer.MaxMultipartMemory = 1024 * 1024 * 32 // 插入较大的资源文件时内存占用较大 https://github.com/siyuan-note/siyuan/issues/5023
|
||||
ginServer.Use(gin.Recovery())
|
||||
ginServer.Use(corsMiddleware()) // 后端服务支持 CORS 预检请求验证 https://github.com/siyuan-note/siyuan/pull/5593
|
||||
ginServer.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedExtensions([]string{".pdf", ".mp3", ".wav", ".ogg", ".mov", ".weba", ".mkv", ".mp4", ".webm"})))
|
||||
ginServer.Use(
|
||||
model.Timing,
|
||||
model.Recover,
|
||||
corsMiddleware(), // 后端服务支持 CORS 预检请求验证 https://github.com/siyuan-note/siyuan/pull/5593
|
||||
gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedExtensions([]string{".pdf", ".mp3", ".wav", ".ogg", ".mov", ".weba", ".mkv", ".mp4", ".webm"})),
|
||||
)
|
||||
|
||||
cookieStore.Options(sessions.Options{
|
||||
Path: "/",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue