Skip to content

Commit

Permalink
implemented post max size
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Jan 18, 2024
1 parent f6025b2 commit cd77bb2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inits/Server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package inits

import (
"ch/kirari04/videocms/config"
"fmt"
"html/template"
"io"
"log"
Expand Down Expand Up @@ -92,6 +93,11 @@ func Server() {
// recovering from panics
app.Use(middleware.Recover())

// body limit
e := echo.New()
postMaxSize := int64(float64(config.ENV.MaxPostSize) / 1000)
e.Use(middleware.BodyLimit(fmt.Sprintf("%dk", postMaxSize)))

// Compression middleware
app.Use(middleware.GzipWithConfig(middleware.GzipConfig{
Skipper: func(c echo.Context) bool {
Expand Down

0 comments on commit cd77bb2

Please sign in to comment.