From 0c91f8b5e7fc2e9ac82b188f32768eeb81aa91c0 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 19 Nov 2024 13:42:25 -0500 Subject: [PATCH] Revert "add trailing slash to the end of the url (#1594)" This reverts commit c82c9a0ff0c00f8f5888c86697602f5afabd7ee1. --- slack_sdk/web/async_base_client.py | 2 -- slack_sdk/web/base_client.py | 2 -- slack_sdk/web/legacy_base_client.py | 2 -- tests/slack_sdk/web/test_web_client.py | 8 -------- 4 files changed, 14 deletions(-) diff --git a/slack_sdk/web/async_base_client.py b/slack_sdk/web/async_base_client.py index 65f852b69..2418b08c3 100644 --- a/slack_sdk/web/async_base_client.py +++ b/slack_sdk/web/async_base_client.py @@ -46,8 +46,6 @@ def __init__( ): self.token = None if token is None else token.strip() """A string specifying an `xoxp-*` or `xoxb-*` token.""" - if not base_url.endswith("/"): - base_url += "/" self.base_url = base_url """A string representing the Slack API base URL. Default is `'https://slack.com/api/'`.""" diff --git a/slack_sdk/web/base_client.py b/slack_sdk/web/base_client.py index 4ce67b0c3..e112d35c8 100644 --- a/slack_sdk/web/base_client.py +++ b/slack_sdk/web/base_client.py @@ -59,8 +59,6 @@ def __init__( ): self.token = None if token is None else token.strip() """A string specifying an `xoxp-*` or `xoxb-*` token.""" - if not base_url.endswith("/"): - base_url += "/" self.base_url = base_url """A string representing the Slack API base URL. Default is `'https://slack.com/api/'`.""" diff --git a/slack_sdk/web/legacy_base_client.py b/slack_sdk/web/legacy_base_client.py index 44d499709..c58e062a1 100644 --- a/slack_sdk/web/legacy_base_client.py +++ b/slack_sdk/web/legacy_base_client.py @@ -62,8 +62,6 @@ def __init__( ): self.token = None if token is None else token.strip() """A string specifying an `xoxp-*` or `xoxb-*` token.""" - if not base_url.endswith("/"): - base_url += "/" self.base_url = base_url """A string representing the Slack API base URL. Default is `'https://slack.com/api/'`.""" diff --git a/tests/slack_sdk/web/test_web_client.py b/tests/slack_sdk/web/test_web_client.py index e6c6697c4..024915a20 100644 --- a/tests/slack_sdk/web/test_web_client.py +++ b/tests/slack_sdk/web/test_web_client.py @@ -229,11 +229,3 @@ def test_user_auth_blocks(self): user_auth_blocks=[DividerBlock(), DividerBlock()], ) self.assertIsNone(new_message.get("error")) - - def test_base_url_appends_trailing_slash_issue_15141(self): - client = self.client - self.assertEqual(client.base_url, "http://localhost:8888/") - - def test_base_url_preserves_trailing_slash_issue_15141(self): - client = WebClient(base_url="http://localhost:8888/") - self.assertEqual(client.base_url, "http://localhost:8888/")