fix: correct argument passing in DoDownloadRequest for MIME type retrieval
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
|||||||
// GetFileTypeFromUrl 获取文件类型,返回 mime type, 例如 image/jpeg, image/png, image/gif, image/bmp, image/tiff, application/pdf
|
// GetFileTypeFromUrl 获取文件类型,返回 mime type, 例如 image/jpeg, image/png, image/gif, image/bmp, image/tiff, application/pdf
|
||||||
// 如果获取失败,返回 application/octet-stream
|
// 如果获取失败,返回 application/octet-stream
|
||||||
func GetFileTypeFromUrl(c *gin.Context, url string, reason ...string) (string, error) {
|
func GetFileTypeFromUrl(c *gin.Context, url string, reason ...string) (string, error) {
|
||||||
response, err := DoDownloadRequest(url, reason...)
|
response, err := DoDownloadRequest(url, []string{"get_mime_type", strings.Join(reason, ", ")}...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.SysLog(fmt.Sprintf("fail to get file type from url: %s, error: %s", url, err.Error()))
|
common.SysLog(fmt.Sprintf("fail to get file type from url: %s, error: %s", url, err.Error()))
|
||||||
return "", err
|
return "", err
|
||||||
|
|||||||
Reference in New Issue
Block a user