@@ -70,14 +70,13 @@ func (g *GiteaBackend) Batch(_ string, pointers []transfer.BatchItem, args trans
7070 g .logger .Log ("json marshal error" , err )
7171 return nil , err
7272 }
73- url := g .server .JoinPath ("objects/batch" ).String ()
7473 headers := map [string ]string {
7574 headerAuthorization : g .authToken ,
7675 headerGiteaInternalAuth : g .internalAuth ,
7776 headerAccept : mimeGitLFS ,
7877 headerContentType : mimeGitLFS ,
7978 }
80- req := newInternalRequestLFS (g .ctx , url , http .MethodPost , headers , bodyBytes )
79+ req := newInternalRequestLFS (g .ctx , g . server . JoinPath ( "objects/batch" ). String () , http .MethodPost , headers , bodyBytes )
8180 resp , err := req .Response ()
8281 if err != nil {
8382 g .logger .Log ("http request error" , err )
@@ -179,13 +178,12 @@ func (g *GiteaBackend) Download(oid string, args transfer.Args) (io.ReadCloser,
179178 g .logger .Log ("argument id incorrect" )
180179 return nil , 0 , transfer .ErrCorruptData
181180 }
182- url := action .Href
183181 headers := map [string ]string {
184182 headerAuthorization : g .authToken ,
185183 headerGiteaInternalAuth : g .internalAuth ,
186184 headerAccept : mimeOctetStream ,
187185 }
188- req := newInternalRequestLFS (g .ctx , url , http .MethodGet , headers , nil )
186+ req := newInternalRequestLFS (g .ctx , toInternalLFSURL ( action . Href ) , http .MethodGet , headers , nil )
189187 resp , err := req .Response ()
190188 if err != nil {
191189 return nil , 0 , fmt .Errorf ("failed to get response: %w" , err )
@@ -225,15 +223,14 @@ func (g *GiteaBackend) Upload(oid string, size int64, r io.Reader, args transfer
225223 g .logger .Log ("argument id incorrect" )
226224 return transfer .ErrCorruptData
227225 }
228- url := action .Href
229226 headers := map [string ]string {
230227 headerAuthorization : g .authToken ,
231228 headerGiteaInternalAuth : g .internalAuth ,
232229 headerContentType : mimeOctetStream ,
233230 headerContentLength : strconv .FormatInt (size , 10 ),
234231 }
235232
236- req := newInternalRequestLFS (g .ctx , url , http .MethodPut , headers , nil )
233+ req := newInternalRequestLFS (g .ctx , toInternalLFSURL ( action . Href ) , http .MethodPut , headers , nil )
237234 req .Body (r )
238235 resp , err := req .Response ()
239236 if err != nil {
@@ -274,14 +271,13 @@ func (g *GiteaBackend) Verify(oid string, size int64, args transfer.Args) (trans
274271 // the server sent no verify action
275272 return transfer .SuccessStatus (), nil
276273 }
277- url := action .Href
278274 headers := map [string ]string {
279275 headerAuthorization : g .authToken ,
280276 headerGiteaInternalAuth : g .internalAuth ,
281277 headerAccept : mimeGitLFS ,
282278 headerContentType : mimeGitLFS ,
283279 }
284- req := newInternalRequestLFS (g .ctx , url , http .MethodPost , headers , bodyBytes )
280+ req := newInternalRequestLFS (g .ctx , toInternalLFSURL ( action . Href ) , http .MethodPost , headers , bodyBytes )
285281 resp , err := req .Response ()
286282 if err != nil {
287283 return transfer .NewStatus (transfer .StatusInternalServerError ), err
0 commit comments