forked from mirror/ledisdb
http interface: not support cmds of repl
This commit is contained in:
parent
95b6dd88fa
commit
33a2e6afb9
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue