diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 13d88258ef..efe40b87ab 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,16 @@ +Release 5.4-alpha1 +------------------ + +This is the first release in the 5.4 release series. + + +Change Log +------------------- + +* Add ContentType.APPLICATION_ZIP_COMPRESSED. + Contributed by Gary Gregory + + Release 5.3 ------------------ diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java b/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java index b8e049961a..b7abdff1d9 100644 --- a/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java +++ b/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java @@ -75,6 +75,17 @@ public final class ContentType implements Serializable { public static final ContentType APPLICATION_JSON = create( "application/json", StandardCharsets.UTF_8); + /** + * Public constant media type for ZIP archives {@code application/x-zip-compressed}. + *

+ * Note that Windows uploads {@code .zip} files with this non-standard MIME type. + *

+ * + * @see ZIP archive application/x-zip-compressed + * @since 5.4 + */ + public static final ContentType APPLICATION_ZIP_COMPRESSED = create("application/x-zip-compressed"); + /** * Public constant media type for {@code application/x-ndjson}. * @since 5.1 diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/TestContentType.java b/httpcore5/src/test/java/org/apache/hc/core5/http/TestContentType.java index cea1eae592..c0e5c00f80 100644 --- a/httpcore5/src/test/java/org/apache/hc/core5/http/TestContentType.java +++ b/httpcore5/src/test/java/org/apache/hc/core5/http/TestContentType.java @@ -40,6 +40,14 @@ */ class TestContentType { + @Test + void testApplicationZipCompressed() { + final ContentType contentType = ContentType.create("application/x-zip-compressed"); + Assertions.assertEquals(contentType.toString(), ContentType.APPLICATION_ZIP_COMPRESSED.toString()); + Assertions.assertTrue(contentType.isSameMimeType(ContentType.APPLICATION_ZIP_COMPRESSED)); + Assertions.assertTrue(ContentType.APPLICATION_ZIP_COMPRESSED.isSameMimeType(contentType)); + } + @Test void testBasis() throws Exception { final ContentType contentType = ContentType.create("text/plain", "US-ASCII");