Merge remote-tracking branch 'origin/master'

This commit is contained in:
HFO4
2022-05-25 20:02:43 +08:00
4 changed files with 17 additions and 3 deletions

View File

@@ -35,7 +35,8 @@ type ssl struct {
}
type unix struct {
Listen string
Listen string
ProxyHeader string `validate:"required_with=Listen"`
}
// slave 作为slave存储端配置

View File

@@ -45,7 +45,8 @@ var SSLConfig = &ssl{
}
var UnixConfig = &unix{
Listen: "",
Listen: "",
ProxyHeader: "X-Forwarded-For",
}
var OptionOverwrite = map[string]interface{}{}

View File

@@ -10,7 +10,9 @@ import (
"encoding/xml"
"errors"
"fmt"
"mime"
"net/http"
"path/filepath"
"strconv"
"time"
@@ -381,7 +383,7 @@ func findContentType(ctx context.Context, fs *filesystem.FileSystem, ls LockSyst
//// Rewind file.
//_, err = f.Seek(0, os.SEEK_SET)
//return ctype, err
return "", nil
return mime.TypeByExtension(filepath.Ext(name)), nil
}
// ETager is an optional interface for the os.FileInfo objects