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

Issue1069 check for model/gltf.binary content type and accept #1075

Merged
merged 13 commits into from
Nov 27, 2021
7 changes: 5 additions & 2 deletions src/DocumentFormat.OpenXml/Packaging/OpenXmlPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ internal void Load(OpenXmlPackage? openXmlPackage, OpenXmlPart? parent, Uri uriT

if (IsContentTypeFixed && metroPart.ContentType != ContentType)
{
var errorMessage = SR.Format(
if (!((metroPart.ContentType == "model/gltf.binary") && (ContentType == "model/gltf-binary")))
twsouthwick marked this conversation as resolved.
Show resolved Hide resolved
{
var errorMessage = SR.Format(
ExceptionMessages.InvalidPartContentType,
metroPart.Uri.OriginalString,
metroPart.ContentType,
ContentType);

throw new OpenXmlPackageException(errorMessage);
throw new OpenXmlPackageException(errorMessage);
}
}

_packagePart = metroPart;
Expand Down