mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 17:40:28 +00:00
feat: torrent scheme deep link and file associations (#866)
This commit is contained in:
30 files changed
+464
-79
No files matched your search
@@ -107,9 +107,9 @@ func (f *Fetcher) Resolve(req *base.Request) error {
|
||||
if base.HttpCodePartialContent == httpResp.StatusCode || (base.HttpCodeOK == httpResp.StatusCode && httpResp.Header.Get(base.HttpHeaderAcceptRanges) == base.HttpHeaderBytes && strings.HasPrefix(httpResp.Header.Get(base.HttpHeaderContentRange), base.HttpHeaderBytes)) {
|
||||
// response 206 status code, support breakpoint continuation
|
||||
res.Range = true
|
||||
// parse content length from Content-Range header, eg: bytes 0-1000/1001
|
||||
// parse content length from Content-Range header, eg: bytes 0-1000/1001 or bytes 0-0/*
|
||||
contentTotal := path.Base(httpResp.Header.Get(base.HttpHeaderContentRange))
|
||||
if contentTotal != "" {
|
||||
if contentTotal != "" && contentTotal != "*" {
|
||||
parse, err := strconv.ParseInt(contentTotal, 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user