Merge current v2.11 into v3.0
This commit is contained in:
commit
bc84fdd006
143 changed files with 8736 additions and 6601 deletions
|
@ -2,6 +2,7 @@ package brotli
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime"
|
||||
|
@ -34,11 +35,11 @@ type Config struct {
|
|||
// NewWrapper returns a new Brotli compressing wrapper.
|
||||
func NewWrapper(cfg Config) (func(http.Handler) http.HandlerFunc, error) {
|
||||
if cfg.MinSize < 0 {
|
||||
return nil, fmt.Errorf("minimum size must be greater than or equal to zero")
|
||||
return nil, errors.New("minimum size must be greater than or equal to zero")
|
||||
}
|
||||
|
||||
if len(cfg.ExcludedContentTypes) > 0 && len(cfg.IncludedContentTypes) > 0 {
|
||||
return nil, fmt.Errorf("excludedContentTypes and includedContentTypes options are mutually exclusive")
|
||||
return nil, errors.New("excludedContentTypes and includedContentTypes options are mutually exclusive")
|
||||
}
|
||||
|
||||
var excludedContentTypes []parsedContentType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue