Skip to content

Commit

Permalink
Revert "add trailing slash to the end of the url (#1594)" (#1597)
Browse files Browse the repository at this point in the history
This reverts commit c82c9a0.
  • Loading branch information
WilliamBergamin authored Nov 19, 2024
1 parent c82c9a0 commit a5b9db6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions slack_sdk/web/async_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'`."""
Expand Down
2 changes: 0 additions & 2 deletions slack_sdk/web/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'`."""
Expand Down
2 changes: 0 additions & 2 deletions slack_sdk/web/legacy_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'`."""
Expand Down
8 changes: 0 additions & 8 deletions tests/slack_sdk/web/test_web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")

0 comments on commit a5b9db6

Please sign in to comment.