fix: resetting response and request Body to unread state (fixes #65)

This commit is contained in:
evilsocket 2018-02-22 13:40:04 +01:00
parent 2771821169
commit 9ba9cb8c52
2 changed files with 6 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package modules
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
@ -61,6 +62,8 @@ func (j *JSRequest) ReadBody() string {
}
j.Body = string(raw)
// reset the request body to the original unread state
j.req.Body = ioutil.NopCloser(bytes.NewBuffer(raw))
return j.Body
}