switched to 400er for not providing the required input
This commit is contained in:
8
api.go
8
api.go
@@ -102,15 +102,15 @@ func GetPackages(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
offset, err := strconv.Atoi(r.URL.Query().Get("offset"))
|
||||
if err != nil {
|
||||
log.Warningf("error parsing page: %v", err)
|
||||
render.Status(r, http.StatusInternalServerError)
|
||||
log.Debugf("error parsing page: %v", err)
|
||||
render.Status(r, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
limit, err := strconv.Atoi(r.URL.Query().Get("limit"))
|
||||
if err != nil {
|
||||
log.Warningf("error parsing page: %v", err)
|
||||
render.Status(r, http.StatusInternalServerError)
|
||||
log.Debugf("error parsing page: %v", err)
|
||||
render.Status(r, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user