MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ProxyRange

Function ProxyRange

server/common/proxy.go:103–117  ·  view source on GitHub ↗
(ctx context.Context, link *model.Link, size int64)

Source from the content-addressed store, hash-verified

101}
102
103func 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
119type InterceptResponseWriter struct {
120 http.ResponseWriter

Callers 2

handleGetHeadPostMethod · 0.92
proxyFunction · 0.92

Calls 2

GetRangeReaderFromLinkFunction · 0.92
GetApiUrlFunction · 0.85

Tested by

no test coverage detected