Skip to content

Commit a6b1400

Browse files
committed
another optimization
1 parent 729fdbb commit a6b1400

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

routers/common/repo.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func ServeData(ctx *context.Context, filePath string, size int64, reader io.Read
6363

6464
fileName := path.Base(filePath)
6565
st := typesniffer.DetectContentType(buf)
66-
isBrowsableType := st.IsBrowsableType()
6766
mimeType := ""
6867
cs := ""
6968

@@ -73,7 +72,7 @@ func ServeData(ctx *context.Context, filePath string, size int64, reader io.Read
7372
}
7473

7574
if mimeType == "" {
76-
if isBrowsableType {
75+
if st.IsBrowsableType() {
7776
mimeType = st.GetContentType()
7877
} else if st.IsText() || ctx.FormBool("render") {
7978
mimeType = "text/plain"

0 commit comments

Comments
 (0)