Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix file_info_query and delete_entity_command.

Pavel Balashou80a670e1f194
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rb
index 3f1a544c640..9716db0819c 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rb
@@ -54,14 +54,10 @@ module Storages::Peripherals::StorageInteraction::Nextcloud
def file_info(file_id, token)
response = Util
.httpx
- .get(
- Util.join_uri_path(@uri, FILE_INFO_PATH, file_id),
- {
- 'Authorization' => "Bearer #{token.access_token}",
- 'Accept' => 'application/json',
- 'OCS-APIRequest' => 'true'
- }
- )
+ .with(headers: { 'Authorization' => "Bearer #{token.access_token}",
+ 'Accept' => 'application/json',
+ 'OCS-APIRequest' => 'true' })
+ .get(Util.join_uri_path(@uri, FILE_INFO_PATH, file_id))
case response.status
when 200
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb
index b2a65fdd633..c2be065d34a 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb
@@ -32,7 +32,6 @@ module Storages::Peripherals::StorageInteraction::Nextcloud::Internal
def initialize(storage)
@uri = storage.uri
- @base_path =
@username = storage.username
@password = storage.password
end
@@ -45,7 +44,9 @@ module Storages::Peripherals::StorageInteraction::Nextcloud::Internal
response = UTIL
.httpx
.basic_auth(@username, @password)
- .delete(UTIL.join_uri_path(@uri, "remote.php/dav/files", CGI.escapeURIComponent(@username), UTIL.escape_path(location)))
+ .delete(UTIL.join_uri_path(@uri, "remote.php/dav/files",
+ CGI.escapeURIComponent(@username),
+ UTIL.escape_path(location)))
case response.status
when 204