mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #65
This commit is contained in:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user