mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-01 17:56:02 +00:00
Fold case of pull request author's username for preview uploads.
Hostnames are lowercase ASCII, so preview upload authorization would always fail for repositories whose owners have uppercase letters in their usernames. Resolves: https://codeberg.org/git-pages/git-pages/issues/228
This commit is contained in:
+1
-1
@@ -620,7 +620,7 @@ func authorizeForgejoActionRun(repoURL string, forgeToken string, prNumber strin
|
||||
return nil, AuthError{http.StatusUnauthorized, "workflow run not triggered by pull request"}
|
||||
}
|
||||
prOwner, prRepository := actionRun.PullRequest.OwnerName, actionRun.PullRequest.RepositoryName
|
||||
if fmt.Sprintf("/%s/%s.git", prOwner, prRepository) != parsedRepoURL.Path {
|
||||
if fmt.Sprintf("/%s/%s.git", strings.ToLower(prOwner), prRepository) != parsedRepoURL.Path {
|
||||
return nil, AuthError{http.StatusUnauthorized, "pull request repository does not match"}
|
||||
}
|
||||
if fmt.Sprintf("%d", actionRun.PullRequest.Number) != prNumber {
|
||||
|
||||
Reference in New Issue
Block a user