From 33a2e6afb932a01f4365876dbb353963dfc3ff25 Mon Sep 17 00:00:00 2001 From: wenyekui Date: Fri, 1 Aug 2014 15:01:16 +0800 Subject: [PATCH] http interface: not support cmds of repl --- server/client_http.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/client_http.go b/server/client_http.go index 2e36572..ed1b7b9 100644 --- a/server/client_http.go +++ b/server/client_http.go @@ -35,8 +35,6 @@ type httpWriter struct { w http.ResponseWriter } -// http context - func newClientHTTP(app *App, w http.ResponseWriter, r *http.Request) { var err error c := new(httpClient) @@ -90,7 +88,11 @@ func (c *httpClient) makeRequest(app *App, r *http.Request, w http.ResponseWrite } req.cmd = strings.ToLower(cmd) - req.args = args + + if req.cmd == "slaveof" || req.cmd == "fullsync" || req.cmd == "sync" { + return nil, fmt.Errorf("unsupported command: '%s'", cmd) + } + req.remoteAddr = c.addr(r) req.resp = &httpWriter{contentType, cmd, w} return req, nil