Skip to content

Commit 4c09cca

Browse files
theoborealisneolynx
authored andcommitted
fixed urlencode for repo name in /put
1 parent ea797f8 commit 4c09cca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

api/repos.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package api
33
import (
44
"fmt"
55
"net/http"
6+
"net/url"
67
"os"
78
"path/filepath"
89
"sort"
@@ -195,7 +196,11 @@ func apiReposEdit(c *gin.Context) {
195196
collectionFactory := context.NewCollectionFactory()
196197
collection := collectionFactory.LocalRepoCollection()
197198

198-
name := c.Params.ByName("name")
199+
name, err := url.PathUnescape(c.Params.ByName("name"))
200+
if err != nil {
201+
AbortWithJSONError(c, 400, err)
202+
return
203+
}
199204
repo, err := collection.ByName(name)
200205
if err != nil {
201206
AbortWithJSONError(c, 404, err)

0 commit comments

Comments
 (0)