mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 04:52:10 -07:00
Update http_proxy_js_request.go
This commit is contained in:
parent
12556bc6be
commit
5e97fbb6eb
1 changed files with 13 additions and 0 deletions
|
@ -103,6 +103,19 @@ func (j *JSRequest) WasModified() bool {
|
||||||
return j.NewHash() != j.refHash
|
return j.NewHash() != j.refHash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (j *JSRequest) CheckIfModifiedAndUpdateHash() bool {
|
||||||
|
newHash := j.NewHash()
|
||||||
|
// body was read
|
||||||
|
if j.bodyRead {
|
||||||
|
j.refHash = newHash
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// check if req was changed and update its hash
|
||||||
|
wasModified := j.refHash != newHash
|
||||||
|
j.refHash = newHash
|
||||||
|
return wasModified
|
||||||
|
}
|
||||||
|
|
||||||
func (j *JSRequest) GetHeader(name, deflt string) string {
|
func (j *JSRequest) GetHeader(name, deflt string) string {
|
||||||
headers := strings.Split(j.Headers, "\r\n")
|
headers := strings.Split(j.Headers, "\r\n")
|
||||||
for i := 0; i < len(headers); i++ {
|
for i := 0; i < len(headers); i++ {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue