summaryrefslogtreecommitdiffstats
path: root/modules/private/internal.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/internal.go')
-rw-r--r--modules/private/internal.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/private/internal.go b/modules/private/internal.go
index b1c868b40f..56852ce63c 100644
--- a/modules/private/internal.go
+++ b/modules/private/internal.go
@@ -10,6 +10,7 @@ import (
"fmt"
"net"
"net/http"
+ "net/url"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/httplib"
@@ -76,7 +77,7 @@ func CheckUnitUser(userID, repoID int64, isAdmin bool, unitType models.UnitType)
// GetRepositoryByOwnerAndName returns the repository by given ownername and reponame.
func GetRepositoryByOwnerAndName(ownerName, repoName string) (*models.Repository, error) {
- reqURL := setting.LocalURL + fmt.Sprintf("api/internal/repo/%s/%s", ownerName, repoName)
+ reqURL := setting.LocalURL + fmt.Sprintf("api/internal/repo/%s/%s", url.PathEscape(ownerName), url.PathEscape(repoName))
log.GitLogger.Trace("GetRepositoryByOwnerAndName: %s", reqURL)
resp, err := newInternalRequest(reqURL, "GET").Response()