From d30b4e203465c1ea0dfe18cb38aab8f170b2f968 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 23 Nov 2024 16:51:24 +0800 Subject: [PATCH] add some --- base/web/serve.go | 4 ++++ core/chat/pod.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/base/web/serve.go b/base/web/serve.go index 05f3c97e..1b6258b4 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -184,6 +184,10 @@ func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.Response kit.If(strings.TrimPrefix(r.URL.Path, key), func(p string) { m.Optionv(ice.MSG_CMDS, strings.Split(p, nfs.PS)) }) }) UserHost(m) + for k, v := range m.R.Header { + m.Info("what %v %v", k, v) + kit.If(strings.HasPrefix(k, "Wechatpay"), func() { m.Option(k, v) }) + } m.W.Header().Add(strings.ReplaceAll(ice.LOG_TRACEID, ".", "-"), m.Option(ice.LOG_TRACEID)) defer func() { Render(m, m.Option(ice.MSG_OUTPUT), kit.List(m.Optionv(ice.MSG_ARGS))...) }() if cmds, ok := _serve_auth(m, key, kit.Simple(m.Optionv(ice.MSG_CMDS)), w, r); ok { diff --git a/core/chat/pod.go b/core/chat/pod.go index 5f16fada..41a82e61 100644 --- a/core/chat/pod.go +++ b/core/chat/pod.go @@ -51,7 +51,7 @@ func init() { if m.Option(ice.MSG_USERPOD, arg[0]); len(arg) == 1 { m.Cmdy(web.SPACE, arg[0], web.SPACE, ice.MAIN) } else if kit.IsIn(arg[1], CMD, "c") { - if kit.IsIn(arg[2], web.ADMIN) { + if m.R.Method == "POST" || kit.IsIn(arg[2], web.ADMIN) { m.Cmdy(web.SPACE, arg[0], arg[2], arg[3:]) } else { m.Options(msg.AppendSimple()).Options(mdb.ICONS, "")