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; }