From a5b9db6df40b7af8bee8696c0226907b84ade395 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 19 Nov 2024 19:09:11 +0000 Subject: [PATCH] Revert "add trailing slash to the end of the url (#1594)" (#1597) 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 65f852b6..2418b08c 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 4ce67b0c..e112d35c 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 44d49970..c58e062a 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 e6c6697c..024915a2 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/")