Skip to content

Commit

Permalink
Merge pull request #1844 from ktoso/wip-grpc-content-type
Browse files Browse the repository at this point in the history
add grpc content type / media type
  • Loading branch information
jrudolph authored Feb 12, 2018
2 parents e27b735 + c05d47f commit e1752b8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ private ContentTypes() { }
public static final ContentType.WithCharset TEXT_CSV_UTF8 =
akka.http.scaladsl.model.ContentTypes.text$divcsv$u0028UTF$minus8$u0029();

public static final ContentType.Binary APPLICATION_GRPC_PROTO = MediaTypes.APPLICATION_GRPC_PROTO.toContentType();

public static final ContentType.Binary NO_CONTENT_TYPE =
akka.http.scaladsl.model.ContentTypes.NoContentType();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ private MediaTypes() { }
public static final MediaType.Binary APPLICATION_MSPOWERPOINT = akka.http.scaladsl.model.MediaTypes.application$divmspowerpoint();
public static final MediaType.Binary APPLICATION_MSWORD = akka.http.scaladsl.model.MediaTypes.application$divmsword();
public static final MediaType.Binary APPLICATION_OCTET_STREAM = akka.http.scaladsl.model.MediaTypes.application$divoctet$minusstream();
public static final MediaType.Binary APPLICATION_GRPC_PROTO = akka.http.scaladsl.model.MediaTypes.application$divgrpc$plusproto();
public static final MediaType.Binary APPLICATION_PDF = akka.http.scaladsl.model.MediaTypes.application$divpdf();
public static final MediaType.Binary APPLICATION_POSTSCRIPT = akka.http.scaladsl.model.MediaTypes.application$divpostscript();
public static final MediaType.WithOpenCharset APPLICATION_RSS_XML = akka.http.scaladsl.model.MediaTypes.application$divrss$plusxml();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ object ContentTypes {
val `text/xml(UTF-8)` = MediaTypes.`text/xml` withCharset HttpCharsets.`UTF-8`
val `text/csv(UTF-8)` = MediaTypes.`text/csv` withCharset HttpCharsets.`UTF-8`

val `application/grpc+proto` = ContentType(MediaTypes.`application/grpc+proto`)

// used for explicitly suppressing the rendering of Content-Type headers on requests and responses
val NoContentType = ContentType(MediaTypes.NoMediaType)
}
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ object MediaTypes extends ObjectRegistry[(String, String), MediaType] {
val `application/javascript` = awoc("javascript", "js")
val `application/json` = awfc("json", HttpCharsets.`UTF-8`, "json")
val `application/json-patch+json` = awfc("json-patch+json", HttpCharsets.`UTF-8`)
val `application/grpc+proto` = abin("grpc+proto", NotCompressible)
val `application/lha` = abin("lha", NotCompressible, "lha")
val `application/lzx` = abin("lzx", NotCompressible, "lzx")
val `application/mspowerpoint` = abin("mspowerpoint", NotCompressible, "pot", "pps", "ppt", "ppz")
Expand Down

0 comments on commit e1752b8

Please sign in to comment.