]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Improve 为keepAlive接口添加速率限制
authorqydysky <qydysky@foxmail.com>
Mon, 15 Jan 2024 15:20:05 +0000 (23:20 +0800)
committerqydysky <qydysky@foxmail.com>
Mon, 15 Jan 2024 15:20:05 +0000 (23:20 +0800)
Reply/F.go

index bc06caf1b965cdbba9e53dece2c75403d91ccf21..f3f95e7a268697f0577f9898d021812e36746fc1 100644 (file)
@@ -1402,6 +1402,9 @@ func init() {
                }
 
                c.C.SerF.Store(path+"keepAlive", func(w http.ResponseWriter, r *http.Request) {
+                       if c.DefaultHttpCheck(c.C, w, r, http.MethodGet) {
+                               return
+                       }
                        if key, e := expirer.Reg(r.URL.Query().Get("key"), time.Second*30); e != nil {
                                w.WriteHeader(http.StatusForbidden)
                        } else {