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
13 changes: 13 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 <ggregory at apache.org>


Release 5.3
------------------

Expand Down
11 changes: 11 additions & 0 deletions httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
* <p>
* Note that Windows uploads {@code .zip} files with this non-standard MIME type.
* </p>
*
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types">ZIP archive application/x-zip-compressed</a>
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down