http interface: not support cmds of repl

This commit is contained in:
wenyekui 2014-08-01 15:01:16 +08:00
parent 95b6dd88fa
commit 33a2e6afb9
1 changed files with 5 additions and 3 deletions

View File

@ -35,8 +35,6 @@ type httpWriter struct {
w http.ResponseWriter w http.ResponseWriter
} }
// http context
func newClientHTTP(app *App, w http.ResponseWriter, r *http.Request) { func newClientHTTP(app *App, w http.ResponseWriter, r *http.Request) {
var err error var err error
c := new(httpClient) 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.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.remoteAddr = c.addr(r)
req.resp = &httpWriter{contentType, cmd, w} req.resp = &httpWriter{contentType, cmd, w}
return req, nil return req, nil