mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
Update http_proxy_js_response.go
This commit is contained in:
parent
57c1aa5a5e
commit
fb787679a8
1 changed files with 4 additions and 7 deletions
|
@ -88,16 +88,13 @@ func (j *JSResponse) GetHeader(name, deflt string) string {
|
|||
|
||||
func (j *JSResponse) 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})
|
||||
}
|
||||
j.Headers = append(j.Headers, JSHeader{name, value})
|
||||
}
|
||||
|
||||
func (j *JSResponse) ToResponse(req *http.Request) (resp *http.Response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue