From 403b70dde885d0f5c422fbd15a165a23e6ccff0c Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Sat, 29 Oct 2016 09:16:38 +0000 Subject: [PATCH] Disable pipes endpoint, we are going for controls instead --- app/pipes.go | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/app/pipes.go b/app/pipes.go index 4073f94d7..08feab372 100644 --- a/app/pipes.go +++ b/app/pipes.go @@ -2,7 +2,6 @@ package app import ( "net/http" - "strconv" log "github.com/Sirupsen/logrus" "github.com/gorilla/mux" @@ -18,11 +17,6 @@ func RegisterPipeRoutes(router *mux.Router, pr PipeRouter) { Path("/api/pipe/{pipeID}/check"). HandlerFunc(requestContextDecorator(checkPipe(pr))) - router.Methods("POST"). - Name("api_pipe_pipeid_resize_tty"). - Path("/api/pipe/{pipeID}/resize_tty/{height}/{width}"). - HandlerFunc(requestContextDecorator(resizeTTY(pr))) - router.Methods("GET"). Name("api_pipe_pipeid"). Path("/api/pipe/{pipeID}"). @@ -53,47 +47,6 @@ func checkPipe(pr PipeRouter) CtxHandlerFunc { } } -func resizeTTY(pr PipeRouter) CtxHandlerFunc { - return func(ctx context.Context, w http.ResponseWriter, r *http.Request) { - var ( - height, width uint64 - err error - ) - id := mux.Vars(r)["pipeID"] - height, err = strconv.ParseUint(mux.Vars(r)["height"], 10, 32) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - return - } - width, err = strconv.ParseUint(mux.Vars(r)["width"], 10, 32) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - return - } - - pipe, _, err := pr.Get(ctx, id, ProbeEnd) - if err != nil { - log.Debugf("Error getting pipe %s: %v", id, err) - http.NotFound(w, r) - return - } - - tty := pipe.GetTTY() - if tty == nil { - // The pipe doesn't have a tty, nothing to do - log.Debugf("Error getting terminal for pipe %s", id) - http.NotFound(w, r) - return - } - - if err = tty.SetSize(uint(height), uint(width)); err != nil { - log.Errorf("Error setting terminal size (%d, %d) of pipe %s: %v", height, width, id, err) - respondWith(w, http.StatusInternalServerError, err) - } - - } -} - func handlePipeWs(pr PipeRouter, end End) CtxHandlerFunc { return func(ctx context.Context, w http.ResponseWriter, r *http.Request) { id := mux.Vars(r)["pipeID"]