Skip to content

Commit 8e693e3

Browse files
committed
Merge PR gophish#3224 (feat(server)!: the endpoint complete campaigns is switched to the post method)
2 parents 53cfcdf + f34d940 commit 8e693e3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

controllers/api/campaign.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (as *Server) CampaignComplete(w http.ResponseWriter, r *http.Request) {
126126
vars := mux.Vars(r)
127127
id, _ := strconv.ParseInt(vars["id"], 0, 64)
128128
switch {
129-
case r.Method == "GET":
129+
case r.Method == "POST" || r.Method == "GET":
130130
err := models.CompleteCampaign(id, ctx.Get(r, "user_id").(int64))
131131
if err != nil {
132132
JSONResponse(w, models.Response{Success: false, Message: "Error completing campaign"}, http.StatusInternalServerError)

static/js/src/app/gophish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ var api = {
102102
},
103103
// complete() - Completes a campaign at POST /campaigns/:id/complete
104104
complete: function (id) {
105-
return query("/campaigns/" + id + "/complete", "GET", {}, true)
105+
return query("/campaigns/" + id + "/complete", "POST", {}, true)
106106
},
107107
// summary() - Queries the API for GET /campaigns/summary
108108
summary: function (id) {

0 commit comments

Comments
 (0)