broker hopefully skips "" cookies
parent
99c6c9179a
commit
9ff1302a73
|
|
@ -71,10 +71,16 @@ func setCookies(db storage.DB, host string, resp *http.Response) error {
|
|||
nameValues := [][2]string{}
|
||||
old, _ := getCookies(db, host)
|
||||
for _, value := range old {
|
||||
if len(value) == 0 {
|
||||
continue
|
||||
}
|
||||
name := strings.Split(value, "=")[0]
|
||||
nameValues = append(nameValues, [2]string{name, value})
|
||||
}
|
||||
for _, value := range resp.Header["Set-Cookie"] {
|
||||
if len(value) == 0 {
|
||||
continue
|
||||
}
|
||||
name := strings.Split(value, "=")[0]
|
||||
found := false
|
||||
for i := range nameValues {
|
||||
|
|
@ -89,6 +95,9 @@ func setCookies(db storage.DB, host string, resp *http.Response) error {
|
|||
}
|
||||
result := []string{}
|
||||
for i := range nameValues {
|
||||
if len(nameValues[i][1]) == 0 {
|
||||
continue
|
||||
}
|
||||
result = append(result, nameValues[i][1])
|
||||
}
|
||||
logtr.Verbosef("setting cookies for %s: %+v", host, result)
|
||||
|
|
|
|||
Loading…
Reference in New Issue