Skip to content

Commit

Permalink
Fixes for getting ping servers (method change from PUT to GET) (#163)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikolai Danylchyk <[email protected]>
Co-authored-by: Mark Mandel <[email protected]>
  • Loading branch information
3 people authored Mar 29, 2023
1 parent 49a6ae0 commit ae6275c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/frontend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func handleUpdateStats(id string, c *gin.Context) {
// WIP: Needs an endpoint to fetch the ping servers
func handlePingServers(id string, c *gin.Context) {
client := &http.Client{}
req, err := http.NewRequest(http.MethodPut, fmt.Sprintf("%s/list", os.Getenv("PING_SERVICE")), c.Request.Body)
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/list", os.Getenv("PING_SERVICE")), c.Request.Body)
if shared.HandleError(c, http.StatusInternalServerError, "fetch ping servers", err) {
return
}
Expand All @@ -239,7 +239,7 @@ func handlePingServers(id string, c *gin.Context) {
c.JSON(http.StatusOK, pingServers)
return
} else {
err := fmt.Errorf("unable to update profile stats, error code: %d", response.StatusCode)
err := fmt.Errorf("unable to fetch ping servers, error code: %d", response.StatusCode)
if shared.HandleError(c, http.StatusBadRequest, "stats update", err) {
return
}
Expand Down

0 comments on commit ae6275c

Please sign in to comment.