Skip to content

Commit 4a6b37f

Browse files
committed
Respect settings during PR migration
1 parent 2b66cb1 commit 4a6b37f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

services/migrations/dump.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,16 @@ func (g *RepositoryDumper) handlePullRequest(pr *base.PullRequest) error {
444444

445445
// SECURITY: We will assume that the pr.PatchURL has been checked
446446
// pr.PatchURL maybe a local file - but note EnsureSafe should be asserting that this safe
447-
resp, err := http.Get(u) // TODO: This probably needs to use the downloader as there may be rate limiting issues here
447+
httpClient := NewMigrationHTTPClient()
448+
449+
req, err := http.NewRequest("GET", u, nil)
450+
if err != nil {
451+
return err
452+
}
453+
req = req.WithContext(g.ctx)
454+
resp, err := httpClient.Do(req)
455+
456+
// resp, err := http.Get(u) // TODO: This probably needs to use the downloader as there may be rate limiting issues here
448457
if err != nil {
449458
return err
450459
}

0 commit comments

Comments
 (0)