mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Fix link-action redirect network error (#27734)
				
					
				
			<img width="823" alt="image" src="https://github.com/go-gitea/gitea/assets/70063547/99da3d5a-c28a-4fd0-8ae0-88461a9142e2"> --------- Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
		| @@ -231,14 +231,15 @@ func EditMilestonePost(ctx *context.Context) { | |||||||
|  |  | ||||||
| // ChangeMilestoneStatus response for change a milestone's status | // ChangeMilestoneStatus response for change a milestone's status | ||||||
| func ChangeMilestoneStatus(ctx *context.Context) { | func ChangeMilestoneStatus(ctx *context.Context) { | ||||||
| 	toClose := false | 	var toClose bool | ||||||
| 	switch ctx.Params(":action") { | 	switch ctx.Params(":action") { | ||||||
| 	case "open": | 	case "open": | ||||||
| 		toClose = false | 		toClose = false | ||||||
| 	case "close": | 	case "close": | ||||||
| 		toClose = true | 		toClose = true | ||||||
| 	default: | 	default: | ||||||
| 		ctx.Redirect(ctx.Repo.RepoLink + "/milestones") | 		ctx.JSONRedirect(ctx.Repo.RepoLink + "/milestones") | ||||||
|  | 		return | ||||||
| 	} | 	} | ||||||
| 	id := ctx.ParamsInt64(":id") | 	id := ctx.ParamsInt64(":id") | ||||||
|  |  | ||||||
| @@ -250,7 +251,7 @@ func ChangeMilestoneStatus(ctx *context.Context) { | |||||||
| 		} | 		} | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 	ctx.Redirect(ctx.Repo.RepoLink + "/milestones?state=" + url.QueryEscape(ctx.Params(":action"))) | 	ctx.JSONRedirect(ctx.Repo.RepoLink + "/milestones?state=" + url.QueryEscape(ctx.Params(":action"))) | ||||||
| } | } | ||||||
|  |  | ||||||
| // DeleteMilestone delete a milestone | // DeleteMilestone delete a milestone | ||||||
|   | |||||||
| @@ -161,14 +161,15 @@ func NewProjectPost(ctx *context.Context) { | |||||||
|  |  | ||||||
| // ChangeProjectStatus updates the status of a project between "open" and "close" | // ChangeProjectStatus updates the status of a project between "open" and "close" | ||||||
| func ChangeProjectStatus(ctx *context.Context) { | func ChangeProjectStatus(ctx *context.Context) { | ||||||
| 	toClose := false | 	var toClose bool | ||||||
| 	switch ctx.Params(":action") { | 	switch ctx.Params(":action") { | ||||||
| 	case "open": | 	case "open": | ||||||
| 		toClose = false | 		toClose = false | ||||||
| 	case "close": | 	case "close": | ||||||
| 		toClose = true | 		toClose = true | ||||||
| 	default: | 	default: | ||||||
| 		ctx.Redirect(ctx.Repo.RepoLink + "/projects") | 		ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects") | ||||||
|  | 		return | ||||||
| 	} | 	} | ||||||
| 	id := ctx.ParamsInt64(":id") | 	id := ctx.ParamsInt64(":id") | ||||||
|  |  | ||||||
| @@ -180,7 +181,7 @@ func ChangeProjectStatus(ctx *context.Context) { | |||||||
| 		} | 		} | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 	ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action"))) | 	ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action"))) | ||||||
| } | } | ||||||
|  |  | ||||||
| // DeleteProject delete a project | // DeleteProject delete a project | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user