revert(quark): remove preset range header
This commit is contained in:
parent
ecd167d2f9
commit
7f35aab071
@ -71,9 +71,6 @@ func (d *Quark) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (
|
|||||||
"Referer": []string{"https://pan.quark.cn"},
|
"Referer": []string{"https://pan.quark.cn"},
|
||||||
"User-Agent": []string{ua},
|
"User-Agent": []string{ua},
|
||||||
},
|
},
|
||||||
PresetHeader: http.Header{
|
|
||||||
"Range": []string{"bytes=0-"},
|
|
||||||
},
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ type LinkArgs struct {
|
|||||||
type Link struct {
|
type Link struct {
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
Header http.Header `json:"header"` // needed header
|
Header http.Header `json:"header"` // needed header
|
||||||
PresetHeader http.Header `json:"preset_header"`
|
|
||||||
Data io.ReadCloser // return file reader directly
|
Data io.ReadCloser // return file reader directly
|
||||||
Status int // status maybe 200 or 206, etc
|
Status int // status maybe 200 or 206, etc
|
||||||
FilePath *string // local file, return the filepath
|
FilePath *string // local file, return the filepath
|
||||||
|
@ -77,10 +77,6 @@ func Proxy(w http.ResponseWriter, r *http.Request, link *model.Link, file model.
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// preset header
|
|
||||||
for h, val := range link.PresetHeader {
|
|
||||||
req.Header[h] = val
|
|
||||||
}
|
|
||||||
// client header
|
// client header
|
||||||
for h, val := range r.Header {
|
for h, val := range r.Header {
|
||||||
if utils.SliceContains(conf.SlicesMap[conf.ProxyIgnoreHeaders], strings.ToLower(h)) {
|
if utils.SliceContains(conf.SlicesMap[conf.ProxyIgnoreHeaders], strings.ToLower(h)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user