Fix: competition write in request header

This commit is contained in:
HFO4 2021-08-31 21:45:35 +08:00
parent 5662daa593
commit 2bd80764a4

View file

@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"path"
"strings"
"sync"
model "github.com/cloudreve/Cloudreve/v3/models"
@ -89,7 +90,11 @@ func (c HTTPClient) Request(method, target string, body io.Reader, opts ...Optio
}
// 添加请求相关设置
req.Header = options.header
if options.header != nil {
for k, v := range options.header {
req.Header.Add(k, strings.Join(v, " "))
}
}
if options.masterMeta {
req.Header.Add("X-Site-Url", model.GetSiteURL().String())