Return empty json if we don't have any protocols to return

This commit is contained in:
Till Faelligen 2022-11-28 10:04:03 +01:00
parent 31f56ac3f4
commit b30a2b7679
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -36,11 +36,17 @@ func Protocols(req *http.Request, asAPI appserviceAPI.AppServiceInternalAPI, dev
return jsonerror.InternalServerError()
}
if !resp.Exists {
if protocol != "" {
return util.JSONResponse{
Code: http.StatusNotFound,
JSON: jsonerror.NotFound("The protocol is unknown."),
}
}
return util.JSONResponse{
Code: http.StatusOK,
JSON: struct{}{},
}
}
if protocol != "" {
return util.JSONResponse{
Code: http.StatusOK,