Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AndrusGerman
Copy link

Reason

Solve problem 3117 which is to change the endpoint from GET to POST of the route that completes the campaign

Changes

  • controllers/api/campaign.go: Changed the enpoint method from POST to GET in campaigns/{id:[0-9]+}/complete

  • static/js/src/app/gophish.js: Changed the enpoint method from POST to GET in query("/campaigns/" + id + "/complete", "POST", {}, true)

  • Compiled the corresponding JavaScript with Gulp (static/js/dist/app/autocomplete.min.js, static/js/dist/app/campaign_results.min.js, static/js/dist/app/settings.min.js...)

@jordan-wright
Copy link
Collaborator

For backwards compatibility, I think we should support GET and POST in the server-side handler, then change the frontend to use POST (like you have here).

Then, the release notes for an upcoming release we could say that the GET endpoint is deprecated and will be removed in the following release. That way, folks that use the API will have a release to update their code.

Also, if you could please remove the minified JS files, it'd be appreciated! We'll build those ourselves since they're tough to review.

@AndrusGerman
Copy link
Author

I will be making the corresponding changes 🫡

@AndrusGerman AndrusGerman force-pushed the feat/complete-campaigns-to-the-post-method branch from 3097a88 to f34d940 Compare September 23, 2024 23:37
@AndrusGerman
Copy link
Author

For backwards compatibility, I think we should support and in the server-side handler, then change the frontend to use (like you have here).GET``POST``POST

Then, the release notes for an upcoming release we could say that the endpoint is deprecated and will be removed in the following release. That way, folks that use the API will have a release to update their code.GET

Also, if you could please remove the minified JS files, it'd be appreciated! We'll build those ourselves since they're tough to review.

This should be enough 😊 @jordan-wright

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants