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

Fixes MS Graph API URI

Marcello Rochaf5b5eda0871b
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/download_link_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/download_link_query.rb
index cf06a4fcb1f..6723f7a76f0 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/download_link_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/download_link_query.rb
@@ -76,7 +76,7 @@ module Storages
end
def uri_path_for(file_id)
- "/v1.0/drives/#{@storage.drive_id}/items/#{file_id}"
+ "/v1.0/drives/#{@storage.drive_id}/items/#{file_id}/content"
end
end
end
diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/download_link_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/download_link_query_spec.rb
index f8725b45be9..5ecb40ba05b 100644
--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/download_link_query_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/download_link_query_spec.rb
@@ -41,7 +41,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::DownloadLink
before do
allow(Storages::Peripherals::StorageInteraction::OneDrive).to receive(:token).and_yield(token)
- stub_request(:get, "https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/items/#{file_link.origin_id}")
+ stub_request(:get, "https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/items/#{file_link.origin_id}/content")
.with(headers: { 'Authorization' => "Bearer #{token.access_token}" })
.and_return(status: 302, body: nil, headers: { 'Location' => 'https://somecool.link/from/microsoft' })
end
@@ -54,7 +54,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::DownloadLink
end
it 'return an error if any other response is received' do
- stub_request(:get, "https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/items/#{file_link.origin_id}")
+ stub_request(:get, "https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/items/#{file_link.origin_id}/content")
.with(headers: { 'Authorization' => "Bearer #{token.access_token}" })
.and_return(status: 200, body: "")