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

MIME prefix constraint removed

Léo SALVADOR63e80becf383
diff --git a/modules/bim/app/services/bim/bcf/viewpoints/set_attributes_service.rb b/modules/bim/app/services/bim/bcf/viewpoints/set_attributes_service.rb
index 5f0ab9d8d7b..960904671bf 100644
--- a/modules/bim/app/services/bim/bcf/viewpoints/set_attributes_service.rb
+++ b/modules/bim/app/services/bim/bcf/viewpoints/set_attributes_service.rb
@@ -62,8 +62,7 @@ module Bim::Bcf
def snapshot_data_complete?
viewpoint["snapshot"] &&
snapshot_extension &&
- snapshot_base64 &&
- snapshot_url_parts.length > 1
+ snapshot_base64
end
def snapshot_content_type
@@ -89,11 +88,11 @@ module Bim::Bcf
end
def snapshot_binary_contents
- Base64.decode64(snapshot_url_parts[2])
- end
-
- def snapshot_url_parts
- snapshot_base64.match(/\Adata:([-\w]+\/[-\w+.]+)?;base64,(.*)/m) || []
+ if snapshot_base64.include?('base64,')
+ Base64.decode64(snapshot_base64.split('base64,').last)
+ else
+ Base64.decode64(snapshot_base64)
+ end
end
def viewpoint