diff --git a/config/version.go b/config/version.go index b3fa1fa..d2184b3 100644 --- a/config/version.go +++ b/config/version.go @@ -1,3 +1,3 @@ package config -var Version = "1.0.0-beta.3" +var Version = "1.0.0" diff --git a/website/routes/api/delete.go b/website/routes/api/delete.go index 308dd93..52b5fa6 100644 --- a/website/routes/api/delete.go +++ b/website/routes/api/delete.go @@ -9,9 +9,6 @@ import ( ) func Delete(c *gin.Context) { - var post URLType - c.BindJSON(&post) - url := c.Param("url") d, err := base64.StdEncoding.DecodeString(url) diff --git a/website/routes/api/insert.go b/website/routes/api/insert.go index ecbc6b2..d28bd62 100644 --- a/website/routes/api/insert.go +++ b/website/routes/api/insert.go @@ -9,7 +9,15 @@ import ( func Insert(c *gin.Context) { var post URLType - c.BindJSON(&post) + err := c.BindJSON(&post) + if err != nil { + c.JSON(http.StatusBadRequest, gin.H{ + "success": false, + "message": "Error Binding JSON!", + }) + + return + } if len(post.URL) < 1 { c.JSON(http.StatusBadRequest, gin.H{ @@ -20,7 +28,7 @@ func Insert(c *gin.Context) { return } - _, err := http.Get(post.URL) + _, err = http.Get(post.URL) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{ "success": false,