From 7c0bf0892d8cda86835dfc3fa0a07a2d69f0e0f7 Mon Sep 17 00:00:00 2001 From: Kevin Stich Date: Thu, 26 Sep 2024 12:11:55 -0700 Subject: [PATCH] Add `application/cbor` to `MediaType`. Fixes #7404 RELNOTES=`net`: Added `application/cbor` to `MediaType` PiperOrigin-RevId: 679244841 --- android/guava/src/com/google/common/net/MediaType.java | 10 ++++++++++ guava/src/com/google/common/net/MediaType.java | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/android/guava/src/com/google/common/net/MediaType.java b/android/guava/src/com/google/common/net/MediaType.java index 74583989768f..90da1acbf048 100644 --- a/android/guava/src/com/google/common/net/MediaType.java +++ b/android/guava/src/com/google/common/net/MediaType.java @@ -171,6 +171,7 @@ private static MediaType addKnownType(MediaType mediaType) { * may be necessary in certain situations for compatibility. */ public static final MediaType TEXT_JAVASCRIPT_UTF_8 = createConstantUtf8(TEXT_TYPE, "javascript"); + /** * Tab separated * values. @@ -458,6 +459,15 @@ private static MediaType addKnownType(MediaType mediaType) { */ public static final MediaType APPLICATION_BINARY = createConstant(APPLICATION_TYPE, "binary"); + /** + * As described in RFC 8949, this + * constant ({@code application/cbor}) is used for the Concise Binary Object Representation (CBOR) + * data format. + * + * @since NEXT + */ + public static final MediaType CBOR = createConstant(APPLICATION_TYPE, "cbor"); + /** * Media type for the GeoJSON Format, a * geospatial data interchange format based on JSON. diff --git a/guava/src/com/google/common/net/MediaType.java b/guava/src/com/google/common/net/MediaType.java index 74583989768f..90da1acbf048 100644 --- a/guava/src/com/google/common/net/MediaType.java +++ b/guava/src/com/google/common/net/MediaType.java @@ -171,6 +171,7 @@ private static MediaType addKnownType(MediaType mediaType) { * may be necessary in certain situations for compatibility. */ public static final MediaType TEXT_JAVASCRIPT_UTF_8 = createConstantUtf8(TEXT_TYPE, "javascript"); + /** * Tab separated * values. @@ -458,6 +459,15 @@ private static MediaType addKnownType(MediaType mediaType) { */ public static final MediaType APPLICATION_BINARY = createConstant(APPLICATION_TYPE, "binary"); + /** + * As described in RFC 8949, this + * constant ({@code application/cbor}) is used for the Concise Binary Object Representation (CBOR) + * data format. + * + * @since NEXT + */ + public static final MediaType CBOR = createConstant(APPLICATION_TYPE, "cbor"); + /** * Media type for the GeoJSON Format, a * geospatial data interchange format based on JSON.