|
@@ -27,10 +27,9 @@ func Limiter(c *gin.Context) { |
|
|
host := c.Request.Host |
|
|
host := c.Request.Host |
|
|
uri := c.Request.URL.String() |
|
|
uri := c.Request.URL.String() |
|
|
|
|
|
|
|
|
buf := make([]byte, 1024*1024) |
|
|
|
|
|
|
|
|
buf := make([]byte, 1024*1024*5) //TODO::5M |
|
|
num, _ := c.Request.Body.Read(buf) |
|
|
num, _ := c.Request.Body.Read(buf) |
|
|
body := buf[:num] |
|
|
body := buf[:num] |
|
|
|
|
|
|
|
|
//body, _ := ioutil.ReadAll(c.Request.Body) |
|
|
//body, _ := ioutil.ReadAll(c.Request.Body) |
|
|
// Write body back |
|
|
// Write body back |
|
|
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body)) |
|
|
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body)) |
|
|