Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/cyclonedx/util/LicenseResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private static LicenseChoice createLicenseChoice(String licenseId, String primar
if (is != null) {
final String text = IOUtils.toString(is, StandardCharsets.UTF_8);
final AttachmentText attachment = new AttachmentText();
attachment.setContentType("plain/text");
attachment.setContentType("text/plain");
switch(licenseTextSettings.getEncoding()){
case NONE:
attachment.setEncoding(null);
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/cyclonedx/util/LicenseResolverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void resolveTestSingleLicense() {
assertEquals("GPL-3.0-only", c1.getLicenses().get(0).getId());
assertEquals("https://www.gnu.org/licenses/gpl-3.0-standalone.html", c1.getLicenses().get(0).getUrl());
assertNotNull(c1.getLicenses().get(0).getAttachmentText().getText());
assertEquals("plain/text", c1.getLicenses().get(0).getAttachmentText().getContentType());
assertEquals("text/plain", c1.getLicenses().get(0).getAttachmentText().getContentType());
assertEquals("base64", c1.getLicenses().get(0).getAttachmentText().getEncoding());

LicenseResolver.LicenseTextSettings textSettings = new LicenseResolver.LicenseTextSettings( true, LicenseResolver.LicenseEncoding.NONE);
Expand All @@ -57,7 +57,7 @@ public void resolveTestSingleLicense() {
assertEquals("GPL-3.0-only", c2.getLicenses().get(0).getId());
assertEquals("https://www.gnu.org/licenses/gpl-3.0-standalone.html", c2.getLicenses().get(0).getUrl());
assertNotNull(c2.getLicenses().get(0).getAttachmentText().getText());
assertEquals("plain/text", c2.getLicenses().get(0).getAttachmentText().getContentType());
assertEquals("text/plain", c2.getLicenses().get(0).getAttachmentText().getContentType());
assertNull(c2.getLicenses().get(0).getAttachmentText().getEncoding());

textSettings = new LicenseResolver.LicenseTextSettings( true, LicenseResolver.LicenseEncoding.BASE64);
Expand All @@ -66,7 +66,7 @@ public void resolveTestSingleLicense() {
assertEquals("GPL-3.0-only", c3.getLicenses().get(0).getId());
assertEquals("https://www.gnu.org/licenses/gpl-3.0-standalone.html", c3.getLicenses().get(0).getUrl());
assertNotNull(c3.getLicenses().get(0).getAttachmentText().getText());
assertEquals("plain/text", c3.getLicenses().get(0).getAttachmentText().getContentType());
assertEquals("text/plain", c3.getLicenses().get(0).getAttachmentText().getContentType());
assertEquals("base64", c3.getLicenses().get(0).getAttachmentText().getEncoding());
}

Expand Down