aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_api.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2024-01-06 16:32:14 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commitaf2c56f96d8be2f783332f5e4c502e8d15835b32 (patch)
tree66a7620e5ef5a288f0f17e0cb9473a2188cbce79 /slack/slack_api.py
parent30e500d4067a161a3e6ea3161ff3440b6959d263 (diff)
downloadwee-slack-af2c56f96d8be2f783332f5e4c502e8d15835b32.tar.gz
URL encode cookies if not encoded
The cookies need to be encoded for the Slack API to accept them, so this makes it work if the config is set with cookies that are not encoded.
Diffstat (limited to 'slack/slack_api.py')
-rw-r--r--slack/slack_api.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/slack/slack_api.py b/slack/slack_api.py
index 0f315a8..76d97cb 100644
--- a/slack/slack_api.py
+++ b/slack/slack_api.py
@@ -10,7 +10,7 @@ from slack.http import http_request
from slack.shared import shared
from slack.slack_message import SlackTs
from slack.task import gather
-from slack.util import chunked
+from slack.util import chunked, get_cookies
if TYPE_CHECKING:
from slack_api.slack_bots_info import SlackBotInfoResponse, SlackBotsInfoResponse
@@ -48,7 +48,7 @@ class SlackApiCommon:
return {
"useragent": f"wee_slack {shared.SCRIPT_VERSION}",
"httpheader": f"Authorization: Bearer {self.workspace.config.api_token.value}",
- "cookie": self.workspace.config.api_cookies.value, # TODO: url_encode_if_not_encoded
+ "cookie": get_cookies(self.workspace.config.api_cookies.value),
}