Introduce a commercial license option alongside AGPL-3.0-only, require a CLA for contributors, and document the terms in COMMERCIAL.md and NOTICE. Add a script to stamp SPDX headers on Go files and apply it across the tree.
22 lines
481 B
Go
22 lines
481 B
Go
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
// SPDX-FileCopyrightText: 2025-2026 Christian Galo
|
|
|
|
package middleware
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/CAFxX/httpcompression"
|
|
)
|
|
|
|
// Compress creates a middleware that compresses HTTP responses using default settings
|
|
func Compress() Middleware {
|
|
return func(next http.Handler) http.Handler {
|
|
compress, err := httpcompression.DefaultAdapter()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return compress(next)
|
|
}
|
|
}
|