Procházet zdrojové kódy

fix issue #586 #543 (#589)

Co-authored-by: Wang Rong <wangron@tesla.com>
Wangrong před 3 roky
rodič
revize
cc9be30ed1
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  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))