From ad71cd28037f1b3dff8b3d3f60c95e2384d2c47b Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Sun, 24 May 2020 21:42:07 +0200 Subject: [PATCH] URL path escape version --- releases.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/releases.go b/releases.go index 2443ada..e4ce729 100644 --- a/releases.go +++ b/releases.go @@ -8,6 +8,7 @@ package newreleases import ( "context" "net/http" + "net/url" "strconv" "time" ) @@ -70,7 +71,7 @@ func (s *ReleasesService) GetByProjectName(ctx context.Context, provider, projec } func (s *ReleasesService) get(ctx context.Context, projectRef, version string) (release *Release, err error) { - err = s.client.request(ctx, http.MethodGet, "v1/projects/"+projectRef+"/releases/"+version, nil, &release) + err = s.client.request(ctx, http.MethodGet, "v1/projects/"+projectRef+"/releases/"+url.PathEscape(version), nil, &release) return release, err } @@ -95,6 +96,6 @@ func (s *ReleasesService) GetNoteByProjectName(ctx context.Context, provider, pr } func (s *ReleasesService) getNote(ctx context.Context, projectRef, version string) (note *ReleaseNote, err error) { - err = s.client.request(ctx, http.MethodGet, "v1/projects/"+projectRef+"/releases/"+version+"/note", nil, ¬e) + err = s.client.request(ctx, http.MethodGet, "v1/projects/"+projectRef+"/releases/"+url.PathEscape(version)+"/note", nil, ¬e) return note, err }