Skip to content

Commit

Permalink
Add application/cbor to MediaType.
Browse files Browse the repository at this point in the history
Fixes #7404

RELNOTES=`net`: Added `application/cbor` to `MediaType`
PiperOrigin-RevId: 679244841
  • Loading branch information
kstich authored and Google Java Core Libraries committed Sep 26, 2024
1 parent 3c7c173 commit 7c0bf08
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions android/guava/src/com/google/common/net/MediaType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

/**
* <a href="http://www.iana.org/assignments/media-types/text/tab-separated-values">Tab separated
* values</a>.
Expand Down Expand Up @@ -458,6 +459,15 @@ private static MediaType addKnownType(MediaType mediaType) {
*/
public static final MediaType APPLICATION_BINARY = createConstant(APPLICATION_TYPE, "binary");

/**
* As described in <a href="https://www.rfc-editor.org/rfc/rfc8949.html">RFC 8949</a>, 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 <a href="https://tools.ietf.org/html/rfc7946">GeoJSON Format</a>, a
* geospatial data interchange format based on JSON.
Expand Down
10 changes: 10 additions & 0 deletions guava/src/com/google/common/net/MediaType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

/**
* <a href="http://www.iana.org/assignments/media-types/text/tab-separated-values">Tab separated
* values</a>.
Expand Down Expand Up @@ -458,6 +459,15 @@ private static MediaType addKnownType(MediaType mediaType) {
*/
public static final MediaType APPLICATION_BINARY = createConstant(APPLICATION_TYPE, "binary");

/**
* As described in <a href="https://www.rfc-editor.org/rfc/rfc8949.html">RFC 8949</a>, 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 <a href="https://tools.ietf.org/html/rfc7946">GeoJSON Format</a>, a
* geospatial data interchange format based on JSON.
Expand Down

0 comments on commit 7c0bf08

Please sign in to comment.