Commit dcef53a 1 parent 872d897 commit dcef53a Copy full SHA for dcef53a
File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -109,18 +109,6 @@ type (
109
109
}
110
110
)
111
111
112
- var defaultOptions = options {
113
- minSize : 256 ,
114
- contentTypes : defaultContentTypes ,
115
- }
116
-
117
- func init () {
118
- defaultOptions .statusCodes = make (map [int ]struct {}, len (defaultStatusCodes ))
119
- for _ , v := range defaultStatusCodes {
120
- defaultOptions .statusCodes [v ] = struct {}{}
121
- }
122
- }
123
-
124
112
// defaultContentTypes is the default list of content types for which
125
113
// a Handler considers gzip compression. This list originates from the
126
114
// file compression.conf within the Apache configuration found at
@@ -241,7 +229,14 @@ func MinSize(n int) Option {
241
229
// headers. If the Content-Type is not set, it will be set by calling
242
230
// http.DetectContentType on the data being written.
243
231
func Middleware (level int , o ... Option ) goa.Middleware {
244
- opts := defaultOptions
232
+ opts := options {
233
+ minSize : 256 ,
234
+ contentTypes : defaultContentTypes ,
235
+ }
236
+ opts .statusCodes = make (map [int ]struct {}, len (defaultStatusCodes ))
237
+ for _ , v := range defaultStatusCodes {
238
+ opts .statusCodes [v ] = struct {}{}
239
+ }
245
240
for _ , opt := range o {
246
241
err := opt (& opts )
247
242
if err != nil {
You can’t perform that action at this time.
0 commit comments