Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable26] Add missing user agent and double slashes cleanup #9194

Merged
merged 4 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions recording/src/nextcloud/talk/recording/BackendNotifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def backendRequest(backend, data):
'OCS-ApiRequest': 'true',
'Talk-Recording-Random': random,
'Talk-Recording-Checksum': checksum,
'User-Agent': 'Mozilla/5.0 (Recording) Nextcloud-Talk v' + recording.__version__,
'User-Agent': recording.USER_AGENT,
}

backendRequest = Request(url, data, headers)
Expand Down Expand Up @@ -187,7 +187,7 @@ def uploadRecording(backend, token, fileName, owner):

logger.info(f"Upload recording {fileName} to {backend} in {token} as {owner}")

url = backend + '/ocs/v2.php/apps/spreed/api/v1/recording/' + token + '/store'
url = backend.rstrip('/') + '/ocs/v2.php/apps/spreed/api/v1/recording/' + token + '/store'

fileContents = None
with open(fileName, 'rb') as file:
Expand All @@ -208,6 +208,7 @@ def uploadRecording(backend, token, fileName, owner):
'OCS-ApiRequest': 'true',
'Talk-Recording-Random': random,
'Talk-Recording-Checksum': checksum,
'User-Agent': recording.USER_AGENT,
}

uploadRequest = Request(url, data, headers)
Expand Down
3 changes: 3 additions & 0 deletions recording/src/nextcloud/talk/recording/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# @copyright Copyright (c) 2023, Daniel Calviño Sánchez ([email protected])
# @copyright Copyright (c) 2023, Elmer Miroslav Mosher Golovin ([email protected])
#
# @license GNU AGPL version 3 or any later version
#
Expand All @@ -21,3 +22,5 @@

RECORDING_STATUS_AUDIO_AND_VIDEO = 1
RECORDING_STATUS_AUDIO_ONLY = 2

USER_AGENT = f'Mozilla/5.0 (Recording) Nextcloud-Talk v{__version__}'