rework not found

This commit is contained in:
Mikaël Cluseau
2023-02-13 18:07:10 +01:00
parent 4acdf88785
commit 5a6c0fa3d8
5 changed files with 29 additions and 29 deletions

View File

@ -58,7 +58,7 @@ func wsDownload(req *restful.Request, resp *restful.Response) {
asset := req.PathParameter("asset")
if token == "" || asset == "" {
wsNotFound(req, resp)
wsNotFound(resp)
return
}
@ -95,7 +95,7 @@ func wsDownload(req *restful.Request, resp *restful.Response) {
})
if !found {
wsNotFound(req, resp)
wsNotFound(resp)
return
}
@ -115,7 +115,7 @@ func wsDownload(req *restful.Request, resp *restful.Response) {
case "cluster":
cluster := cfg.ClusterByName(spec.Name)
if cluster == nil {
wsNotFound(req, resp)
wsNotFound(resp)
return
}
@ -125,13 +125,13 @@ func wsDownload(req *restful.Request, resp *restful.Response) {
resp.Write([]byte(cluster.Addons))
default:
wsNotFound(req, resp)
wsNotFound(resp)
}
case "host":
host := cfg.Host(spec.Name)
if host == nil {
wsNotFound(req, resp)
wsNotFound(resp)
return
}
@ -145,6 +145,6 @@ func wsDownload(req *restful.Request, resp *restful.Response) {
renderHost(resp.ResponseWriter, req.Request, asset, host, cfg)
default:
wsNotFound(req, resp)
wsNotFound(resp)
}
}