update
This commit is contained in:
@@ -155,3 +155,20 @@ func handleMessage(sender im.Sender) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func FetchCookieValue(ps ...string) string {
|
||||
var key, cookies string
|
||||
if len(ps) == 2 {
|
||||
if len(ps[0]) > len(ps[1]) {
|
||||
key, cookies = ps[1], ps[0]
|
||||
} else {
|
||||
key, cookies = ps[0], ps[1]
|
||||
}
|
||||
}
|
||||
match := regexp.MustCompile(key + `=([^;]*);{0,1}`).FindStringSubmatch(cookies)
|
||||
if len(match) == 2 {
|
||||
return match[1]
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user