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