From b9393e9e39dd59802860f592453b4ea7677d7a91 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 3 Mar 2016 12:35:04 +0000 Subject: [PATCH] Review feedback --- app/pipes.go | 4 ++-- client/app/scripts/utils/web-api-utils.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/pipes.go b/app/pipes.go index 8da9e9431..6bb5742f6 100644 --- a/app/pipes.go +++ b/app/pipes.go @@ -34,10 +34,10 @@ func checkPipe(pr PipeRouter, end End) CtxHandlerFunc { id := mux.Vars(r)["pipeID"] _, _, ok := pr.Get(ctx, id, end) if !ok { - http.NotFound(w, r) + w.WriteHeader(http.StatusNoContent) return } - defer pr.Release(ctx, id, end) + pr.Release(ctx, id, end) } } diff --git a/client/app/scripts/utils/web-api-utils.js b/client/app/scripts/utils/web-api-utils.js index deacca699..3fd3a979d 100644 --- a/client/app/scripts/utils/web-api-utils.js +++ b/client/app/scripts/utils/web-api-utils.js @@ -218,17 +218,17 @@ export function getPipeStatus(pipeId) { reqwest({ method: 'GET', url: url, - success: function(res) { - log('ERROR: expected responses: [200, 404]. Got:', res); - }, error: function(err) { + log('ERROR: unexpected response:', err); + }, + success: function(res) { const status = { 200: 'PIPE_ALIVE', - 404: 'PIPE_DELETED' - }[err.status]; + 204: 'PIPE_DELETED' + }[res.status]; if (!status) { - log('Unexpected pipe status:', err.status); + log('Unexpected pipe status:', res.status); return; }