mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 11:07:18 -04:00 
			
		
		
		
	Backport #33620 by lunny Fix #33603 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -15,6 +15,7 @@ import ( | ||||
| 	repo_model "code.gitea.io/gitea/models/repo" | ||||
| 	user_model "code.gitea.io/gitea/models/user" | ||||
| 	"code.gitea.io/gitea/modules/git" | ||||
| 	"code.gitea.io/gitea/modules/httplib" | ||||
| 	"code.gitea.io/gitea/modules/log" | ||||
| 	"code.gitea.io/gitea/modules/repository" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| @@ -875,6 +876,11 @@ func (m *webhookNotifier) CreateCommitStatus(ctx context.Context, repo *repo_mod | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	// as a webhook url, target should be an absolute url. But for internal actions target url | ||||
| 	// the target url is a url path with no host and port to make it easy to be visited | ||||
| 	// from multiple hosts. So we need to convert it to an absolute url here. | ||||
| 	target := httplib.MakeAbsoluteURL(ctx, status.TargetURL) | ||||
|  | ||||
| 	payload := api.CommitStatusPayload{ | ||||
| 		Context:     status.Context, | ||||
| 		CreatedAt:   status.CreatedUnix.AsTime().UTC(), | ||||
| @@ -882,7 +888,7 @@ func (m *webhookNotifier) CreateCommitStatus(ctx context.Context, repo *repo_mod | ||||
| 		ID:          status.ID, | ||||
| 		SHA:         commit.Sha1, | ||||
| 		State:       status.State.String(), | ||||
| 		TargetURL:   status.TargetURL, | ||||
| 		TargetURL:   target, | ||||
|  | ||||
| 		Commit: apiCommit, | ||||
| 		Repo:   convert.ToRepo(ctx, repo, access_model.Permission{AccessMode: perm.AccessModeOwner}), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user