@@ -123,7 +123,7 @@ func (ssc *StartServerCommand) start0() {
123
123
go func () {
124
124
err := http .ListenAndServe (ssc .ip + ":" + ssc .port , nil )
125
125
if err != nil {
126
- log .Errorf (context .Background (),"start blade server error, %v" , err )
126
+ log .Errorf (context .Background (), "start blade server error, %v" , err )
127
127
//log.Error(err, "start blade server error")
128
128
os .Exit (1 )
129
129
}
@@ -134,20 +134,7 @@ func (ssc *StartServerCommand) start0() {
134
134
135
135
func Register (requestPath string ) {
136
136
http .HandleFunc (requestPath , func (writer http.ResponseWriter , request * http.Request ) {
137
- err := request .ParseForm ()
138
- if err != nil {
139
- fmt .Fprintf (writer , spec .ReturnFail (spec .ParameterRequestFailed , err .Error ()).Print ())
140
- return
141
- }
142
- cmds := request .Form ["cmd" ]
143
- if len (cmds ) != 1 {
144
- fmt .Fprintf (writer , spec .ResponseFailWithFlags (spec .ParameterLess , "cmd" ).Print ())
145
- return
146
- }
147
- ctx := context .WithValue (context .Background (), "mode" , "server" )
148
- response := channel .NewLocalChannel ().Run (ctx , path .Join (util .GetProgramPath (), "blade" ), cmds [0 ])
149
- log .Debugf (ctx , "Server response: %v" , response )
150
- fmt .Fprintf (writer , response .Print ())
137
+ fmt .Fprintf (writer , spec .ReturnFail (spec .CommandIllegal , "Server mode is disabled" ).Print ())
151
138
})
152
139
}
153
140
0 commit comments