You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Filling out the following details about bugs will help us solve your issue sooner.)
I just notice that my last PR #1594 cause an error after I added the logic in the legacy_base_client.py due to a double slash in the api_url when concatenating the base_url with the api_method.py.
(Paste the output of python --version)
Python 3.12.7
OS info
(Paste the output of sw_vers && uname -v on macOS/Linux or ver on Windows OS)
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., setup.py))
source env_3.9.6/bin/activate
./scripts/run_validation.sh
Expected result:
Expected to pass all the tests
Actual result:
Test test_issue_690_oauth_v2_access from tests/web/test_web_client.py fails
Proposed solution:
Update the _get_url(base_url: str, api_method: str) -> str ensures that a properly formatted absolute URL is constructed from a base_url and an api_method, handling edge cases where redundant slashes might cause incorrect URLs.
def_get_url(base_url: str, api_method: str) ->str:
"""Joins the base Slack URL and an API method to form an absolute URL. Args: base_url (str): The base URL api_method (str): The Slack Web API method. e.g. 'chat.postMessage' Returns: The absolute API URL. e.g. 'https://slack.com/api/chat.postMessage' """ifbase_url.endswith("/") andapi_method.startswith("/"):
base_url=base_url.rstrip("/")
returnurljoin(base_url, api_method)
Apologies for the inconvenience and my lack of attention, I'm sending a PR to fix this issue ASAP.
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
(Filling out the following details about bugs will help us solve your issue sooner.)
I just notice that my last PR #1594 cause an error after I added the logic in the
legacy_base_client.py
due to a double slash in the api_url when concatenating thebase_url
with theapi_method.py
.Reproducible in:
The Slack SDK version
(Paste the output of
pip freeze | grep slack
)Python runtime version
(Paste the output of
python --version
)Python 3.12.7
OS info
(Paste the output of
sw_vers && uname -v
on macOS/Linux orver
on Windows OS)Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., setup.py))
Expected result:
Expected to pass all the tests
Actual result:
Test
test_issue_690_oauth_v2_access
fromtests/web/test_web_client.py
failsProposed solution:
Update the
_get_url(base_url: str, api_method: str) -> str
ensures that a properly formatted absolute URL is constructed from abase_url
and anapi_method
, handling edge cases where redundant slashes might cause incorrect URLs.Apologies for the inconvenience and my lack of attention, I'm sending a PR to fix this issue ASAP.
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
The text was updated successfully, but these errors were encountered: