Move content encoding in the beginning of the middleware chain, update dependencies

This commit is contained in:
Ingo Oppermann
2024-10-09 14:25:42 +02:00
parent 4d6eb122b0
commit f97943b275
348 changed files with 18733 additions and 5367 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/datarhei/core/v16/glob"
"github.com/datarhei/core/v16/log"
"github.com/datarhei/core/v16/mem"
)
// MemConfig is the config that is required for creating
@@ -126,37 +127,10 @@ func (f *memFile) free() {
f.data = nil
}
type fileDataPool struct {
pool sync.Pool
}
var pool *fileDataPool = nil
func NewFileDataPool() *fileDataPool {
p := &fileDataPool{
pool: sync.Pool{
New: func() any {
return &bytes.Buffer{}
},
},
}
return p
}
func (p *fileDataPool) Get() *bytes.Buffer {
buf := p.pool.Get().(*bytes.Buffer)
buf.Reset()
return buf
}
func (p *fileDataPool) Put(buf *bytes.Buffer) {
p.pool.Put(buf)
}
var pool *mem.BufferPool = nil
func init() {
pool = NewFileDataPool()
pool = mem.NewBufferPool()
}
type memFilesystem struct {