Skip to content

Commit 2aa0700

Browse files
authored
app_api-2.0: fixed forgot about slash removal (#213)
Subj, **make CI green**. --------- Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
1 parent 533f231 commit 2aa0700

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/analysis-coverage.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
156156
- name: Uninstall NcPyApi
157157
run: |
158-
php occ app_api:app:unregister "$APP_ID" --silent
158+
php occ app_api:app:unregister "$APP_ID" --silent --force
159159
php occ app_api:daemon:unregister manual_install
160160
161161
- name: Generate coverage report (2)
@@ -316,7 +316,7 @@ jobs:
316316
317317
- name: Uninstall NcPyApi
318318
run: |
319-
php occ app_api:app:unregister "$APP_ID" --silent
319+
php occ app_api:app:unregister "$APP_ID" --silent --force
320320
php occ app_api:daemon:unregister manual_install
321321
322322
- name: Generate coverage report (2)
@@ -610,7 +610,7 @@ jobs:
610610
611611
- name: Uninstall NcPyApi
612612
run: |
613-
php occ app_api:app:unregister "$APP_ID" --silent
613+
php occ app_api:app:unregister "$APP_ID" --silent --force
614614
php occ app_api:daemon:unregister manual_install
615615
616616
- name: Generate coverage report (2)
@@ -790,7 +790,7 @@ jobs:
790790

791791
- name: Uninstall NcPyApi
792792
run: |
793-
php occ app_api:app:unregister "$APP_ID" --silent
793+
php occ app_api:app:unregister "$APP_ID" --silent --force
794794
php occ app_api:daemon:unregister manual_install
795795
796796
- name: Generate coverage report (2)

nc_py_api/talk_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def __init__(self, callback_url: str, display_name: str, description: str = ""):
211211
:param display_name: The display name of the bot that is shown as author when it posts a message or reaction.
212212
:param description: Description of the bot helping moderators to decide if they want to enable this bot.
213213
"""
214-
self.callback_url = callback_url
214+
self.callback_url = callback_url.lstrip("/")
215215
self.display_name = display_name
216216
self.description = description
217217

@@ -318,7 +318,7 @@ async def _sign_send_request(self, method: str, url_suffix: str, data: dict, dat
318318

319319
def __get_bot_secret(callback_url: str) -> str:
320320
sha_1 = hashlib.sha1(usedforsecurity=False)
321-
string_to_hash = os.environ["APP_ID"] + "_" + callback_url
321+
string_to_hash = os.environ["APP_ID"] + "_" + callback_url.lstrip("/")
322322
sha_1.update(string_to_hash.encode("UTF-8"))
323323
return sha_1.hexdigest()
324324

0 commit comments

Comments
 (0)