Skip to content

Commit d3d32a7

Browse files
committed
minor refactor
1 parent 257f44f commit d3d32a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/public/public.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options)
109109
}
110110
}
111111

112-
var f http.File
113-
split := commaRe.Split(ctx.Req.Header.Get("Accept-Encoding"), -1)
114112
encodings := make(map[string]bool)
115-
for i := range split {
116-
encodings[split[i]] = true
113+
for _, encoding := range commaRe.Split(ctx.Req.Header.Get("Accept-Encoding"), -1) {
114+
encodings[encoding] = true
117115
}
118116

117+
var f http.File
119118
var err error
119+
120120
if encodings["br"] {
121121
f, err = opt.FileSystem.Open(file + ".br")
122122
if f != nil {

0 commit comments

Comments
 (0)