白名单中的IP不受请求限制的影响

This commit is contained in:
刘祥超
2022-04-25 11:11:25 +08:00
parent a6673449db
commit fb3610966a

View File

@@ -2,9 +2,18 @@
package nodes
import "net/http"
import (
"github.com/TeaOSLab/EdgeNode/internal/iplibrary"
"net/http"
)
func (this *HTTPRequest) doRequestLimit() (shouldStop bool) {
// 是否在全局名单中
_, isInAllowedList := iplibrary.AllowIP(this.RemoteAddr(), this.ReqServer.Id)
if isInAllowedList {
return false
}
// 检查请求Body尺寸
// TODO 处理分片提交的内容
if this.web.RequestLimit.MaxBodyBytes() > 0 &&