diff --git a/components/nexus-repository-services/src/main/java/org/sonatype/nexus/repository/mime/DefaultContentValidator.java b/components/nexus-repository-services/src/main/java/org/sonatype/nexus/repository/mime/DefaultContentValidator.java index faa5985ce6..086b4b153a 100644 --- a/components/nexus-repository-services/src/main/java/org/sonatype/nexus/repository/mime/DefaultContentValidator.java +++ b/components/nexus-repository-services/src/main/java/org/sonatype/nexus/repository/mime/DefaultContentValidator.java @@ -72,7 +72,7 @@ public String determineContentType(final boolean strictContentTypeValidation, contentDetectedMimeTypes.addAll(mimeSupport.detectMimeTypes(is, contentName)); } adjustIfHtml(contentDetectedMimeTypes); - log.debug("Mime support detects {} as {}", contentName, contentDetectedMimeTypes); + log.info("Mime support detects {} as {}", contentName, contentDetectedMimeTypes); if (strictContentTypeValidation && isUnknown(contentDetectedMimeTypes)) { throw new InvalidContentException("Content type could not be determined: " + contentName); @@ -86,12 +86,16 @@ public String determineContentType(final boolean strictContentTypeValidation, mimeRulesSource != null ? mimeRulesSource : MimeRulesSource.NOOP) ); adjustIfHtml(nameAssumedMimeTypes); - log.debug("Mime support assumes {} as {}", contentName, nameAssumedMimeTypes); + log.info("Mime support assumes {} as {} {}", contentName, nameAssumedMimeTypes); if (!isUnknown(nameAssumedMimeTypes)) { Set intersection = Sets.intersection(contentDetectedMimeTypes, nameAssumedMimeTypes); log.debug("content/name types intersection {}", intersection); - if (strictContentTypeValidation && intersection.isEmpty()) { + if ( strictContentTypeValidation && intersection.isEmpty() + && !("[application/x-apple-diskimage]".equals(nameAssumedMimeTypes.toString()) + && ( "[application/x-bzip]".equals(contentDetectedMimeTypes.toString()) + || "[application/zlib]".equals(contentDetectedMimeTypes.toString())) ) + ) { throw new InvalidContentException( String.format("Detected content type %s, but expected %s: %s", contentDetectedMimeTypes, nameAssumedMimeTypes, contentName)