This commit is contained in:
Tomas Dvorak
2025-10-19 17:16:57 +02:00
parent e9a63073e5
commit 77213f4e83
76 changed files with 9728 additions and 935 deletions
+4 -1
View File
@@ -95,6 +95,9 @@ func main() {
// Initialize Gin router
r := gin.Default()
// Set max multipart memory to match upload size limit (default is 32MB)
r.MaxMultipartMemory = config.AppConfig.MaxUploadSize
// Enable gzip compression for responses
r.Use(gzip.Gzip(gzip.DefaultCompression))
@@ -103,7 +106,7 @@ func main() {
r.Use(func(c *gin.Context) {
// Security headers
c.Writer.Header().Set("X-Content-Type-Options", "nosniff")
c.Writer.Header().Set("X-Frame-Options", "DENY")
c.Writer.Header().Set("X-Frame-Options", "SAMEORIGIN")
c.Writer.Header().Set("Referrer-Policy", "no-referrer-when-downgrade")
// Add HSTS when using HTTPS (including behind a proxy)
if c.Request.TLS != nil || c.Request.Header.Get("X-Forwarded-Proto") == "https" {