(ctx context.Context, link *model.Link, size int64)
| 101 | } |
| 102 | |
| 103 | func ProxyRange(ctx context.Context, link *model.Link, size int64) *model.Link { |
| 104 | if link.RangeReader == nil && !strings.HasPrefix(link.URL, GetApiUrl(ctx)+"/") { |
| 105 | if link.ContentLength > 0 { |
| 106 | size = link.ContentLength |
| 107 | } |
| 108 | rrf, err := stream.GetRangeReaderFromLink(size, link) |
| 109 | if err == nil { |
| 110 | return &model.Link{ |
| 111 | RangeReader: rrf, |
| 112 | ContentLength: size, |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | return link |
| 117 | } |
| 118 | |
| 119 | type InterceptResponseWriter struct { |
| 120 | http.ResponseWriter |
no test coverage detected