From bf41841eebd4753504e068ba79e879a679ae2961 Mon Sep 17 00:00:00 2001 From: terrorbyte Date: Sun, 20 Dec 2020 13:56:00 -0600 Subject: [PATCH] Added some ergonomics fixes --- cmd/extractors/linux/extract.sh | 0 examples/config.json | 14 +++++++------- util.go | 7 +++++-- 3 files changed, 12 insertions(+), 9 deletions(-) mode change 100644 => 100755 cmd/extractors/linux/extract.sh diff --git a/cmd/extractors/linux/extract.sh b/cmd/extractors/linux/extract.sh old mode 100644 new mode 100755 diff --git a/examples/config.json b/examples/config.json index b2968bf..7e0b954 100644 --- a/examples/config.json +++ b/examples/config.json @@ -1,9 +1,9 @@ { "UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36", - "Authority": "kladjaklj.slack.com", - "URL": "kladjaklj.slack.com", - "Token": "xoxp-fake", - "BCookie":"bcookie", - "DCookie":"dcookie", - "XCookie":"xcookie" -} \ No newline at end of file + "Authority": "example.slack.com", + "URL": "example.slack.com", + "Token": "xoxp-xxxxxxxx-xxxxxxxx", + "BCookie":"b=", + "DCookie":"d=", + "XCookie":"x=" +} diff --git a/util.go b/util.go index 9a13568..cf7fd13 100644 --- a/util.go +++ b/util.go @@ -107,12 +107,15 @@ func ReadConfig(file string) (Smack, error) { return Smack{}, err } // The cookie still needs to be set for d and b even if the variables are empty - if smc.DCookie == "" { + if smc.DCookie == "" || sm.DCookie == "dcookie" { smc.DCookie = "d=" } - if smc.BCookie == "" { + if smc.BCookie == "" || sm.BCookie == "bcookie" { smc.BCookie = "b=" } + if smc.XCookie == "" || sm.XCookie == "xcookie" { + smc.XCookie = "x=" + } sm := NewRequest(smc.URL, smc.Token) sm.SetHeaders(map[string]string{ "Cookie": strings.Join([]string{smc.DCookie, smc.XCookie, smc.BCookie}, "; "), -- 2.45.2