Escape ProtectedTags tag wildcards

When protecting tags, it's very normal to use characters that are not
safe to use in a url like `/` or `*`. This change should make it safe.
parent 58967a9d
......@@ -72,7 +72,7 @@ func (s *ProtectedTagsService) GetProtectedTag(pid interface{}, tag string, opti
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/protected_tags/%s", pathEscape(project), tag)
u := fmt.Sprintf("projects/%s/protected_tags/%s", pathEscape(project), pathEscape(tag))
req, err := s.client.NewRequest("GET", u, nil, options)
if err != nil {
......@@ -134,7 +134,7 @@ func (s *ProtectedTagsService) UnprotectRepositoryTags(pid interface{}, tag stri
if err != nil {
return nil, err
}
u := fmt.Sprintf("projects/%s/protected_tags/%s", pathEscape(project), tag)
u := fmt.Sprintf("projects/%s/protected_tags/%s", pathEscape(project), pathEscape(tag))
req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment