mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-09-26 20:11:11 +08:00
fix: 修复mimetype检测误差问题
This commit is contained in:
1
go.mod
1
go.mod
@@ -135,6 +135,7 @@ require (
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/gookit/goutil v0.6.11
|
||||
github.com/gorilla/sessions v1.2.2
|
||||
github.com/h2non/filetype v1.1.3
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
|
2
go.sum
2
go.sum
@@ -213,6 +213,8 @@ github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTj
|
||||
github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
|
||||
github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg=
|
||||
github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY=
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
|
||||
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
|
@@ -22,7 +22,7 @@ const (
|
||||
AppName = "QuarkGo"
|
||||
|
||||
// 版本号
|
||||
Version = "2.1.41"
|
||||
Version = "2.1.42"
|
||||
|
||||
// 包名
|
||||
PkgName = "github.com/quarkcms/quark-go/v2"
|
||||
|
@@ -12,12 +12,12 @@ import (
|
||||
_ "image/jpeg"
|
||||
_ "image/png"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/aliyun/aliyun-oss-go-sdk/oss"
|
||||
"github.com/gabriel-vasile/mimetype"
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/quarkcms/quark-go/v2/pkg/utils/file"
|
||||
@@ -119,7 +119,7 @@ func (p *FileSystem) Reader(file *File) *FileSystem {
|
||||
file.ContentType = file.Header["Content-Type"][0]
|
||||
}
|
||||
} else {
|
||||
file.ContentType = http.DetectContentType(file.Content)
|
||||
file.ContentType = mimetype.Detect(file.Content).String()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user