mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 21:12:05 -07:00
Update http_proxy_js_request.go
This commit is contained in:
parent
78ae5095c4
commit
e17a848f8a
1 changed files with 5 additions and 8 deletions
|
@ -100,17 +100,14 @@ func (j *JSRequest) GetHeader(name, deflt string) string {
|
|||
|
||||
func (j *JSRequest) SetHeader(name, value string) {
|
||||
name = strings.ToLower(name)
|
||||
found := false
|
||||
for _, h := range j.Headers {
|
||||
for i, h := range j.Headers {
|
||||
if name == strings.ToLower(h.Name) {
|
||||
found = true
|
||||
h.Value = value
|
||||
j.Headers[i].Value = value
|
||||
return
|
||||
}
|
||||
}
|
||||
if found == false {
|
||||
j.Headers = append(j.Headers, JSHeader{name, value})
|
||||
}
|
||||
}
|
||||
|
||||
func (j *JSRequest) ReadBody() string {
|
||||
raw, err := ioutil.ReadAll(j.req.Body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue