Skip to content

Commit

Permalink
Use endpoint of HTTP Runner
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Oct 8, 2023
1 parent a7d4706 commit 8858675
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,21 @@ func (o *operator) collectCoverage(ctx context.Context) (*coverage, error) {
i := ov.doc.Paths.Find(varRep.ReplaceAllString(qRep.ReplaceAllString(p, ""), "{x}"))
if i == nil {
// Find path using router (e.g. /v1/users/1)
const tmpURL = "https://runn.test"
tu, err := url.Parse(tmpURL)
if err != nil {
return nil, err
}
for _, server := range ov.doc.Servers {
su, err := url.Parse(server.URL)
if err != nil {
return nil, err
}
su.Host = tu.Host
su.Opaque = tu.Opaque
su.Scheme = tu.Scheme
su.Host = r.endpoint.Host
su.Opaque = r.endpoint.Opaque
su.Scheme = r.endpoint.Scheme
server.URL = su.String()
}
router, err := legacyrouter.NewRouter(ov.doc)
if err != nil {
return nil, err
}
req, err := http.NewRequest(method, tmpURL+p, nil)
req, err := http.NewRequest(method, r.endpoint.String()+p, nil)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8858675

Please sign in to comment.