Escape URL path parameters in GetJob request
Uses url.PathEscape for owner, repo, and jobID in the GetJob API request to ensure proper encoding and prevent issues with special characters.
This commit is contained in:
parent
b890f880c0
commit
9ec10a4d31
1 changed files with 1 additions and 1 deletions
|
|
@ -102,7 +102,7 @@ func (c *CAPIClient) GetJob(ctx context.Context, owner, repo, jobID string) (*Jo
|
|||
if owner == "" || repo == "" || jobID == "" {
|
||||
return nil, errors.New("owner, repo, and jobID are required")
|
||||
}
|
||||
url := fmt.Sprintf("%s/%s/%s/%s", jobsBasePathV1, owner, repo, jobID)
|
||||
url := fmt.Sprintf("%s/%s/%s/%s", jobsBasePathV1, url.PathEscape(owner), url.PathEscape(repo), url.PathEscape(jobID))
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue