mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 13:02:12 -07:00
fix: resetting response and request Body to unread state (fixes #65)
This commit is contained in:
parent
2771821169
commit
9ba9cb8c52
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue