Explorar o código

fix issue #586 #543 (#589)

Co-authored-by: Wang Rong <wangron@tesla.com>
Wangrong %!s(int64=3) %!d(string=hai) anos
pai
achega
cc9be30ed1
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      officialaccount/server/server.go

+ 5 - 0
officialaccount/server/server.go

@@ -73,6 +73,11 @@ func (srv *Server) Serve() error {
 	if err != nil {
 		return err
 	}
+	// 非安全模式下,请求处理方法返回为nil则直接回复success给微信服务器
+	if response == nil && !srv.isSafeMode {
+		srv.String("success")
+		return nil
+	}
 
 	// debug print request msg
 	log.Debugf("request msg =%s", string(srv.RequestRawXMLMsg))