diff --git a/ktor-http/api/ktor-http.api b/ktor-http/api/ktor-http.api index 3f490eb1bf2..c9985208b5f 100644 --- a/ktor-http/api/ktor-http.api +++ b/ktor-http/api/ktor-http.api @@ -175,6 +175,7 @@ public final class io/ktor/http/ContentType$Application { public final fun getXlsx ()Lio/ktor/http/ContentType; public final fun getXml ()Lio/ktor/http/ContentType; public final fun getXml_Dtd ()Lio/ktor/http/ContentType; + public final fun getYaml ()Lio/ktor/http/ContentType; public final fun getZip ()Lio/ktor/http/ContentType; } diff --git a/ktor-http/api/ktor-http.klib.api b/ktor-http/api/ktor-http.klib.api index c4372c4f9a4..25d61d278b7 100644 --- a/ktor-http/api/ktor-http.klib.api +++ b/ktor-http/api/ktor-http.klib.api @@ -458,6 +458,8 @@ final class io.ktor.http/ContentType : io.ktor.http/HeaderValueWithParameters { final fun (): io.ktor.http/ContentType // io.ktor.http/ContentType.Application.Xml.|(){}[0] final val Xml_Dtd // io.ktor.http/ContentType.Application.Xml_Dtd|{}Xml_Dtd[0] final fun (): io.ktor.http/ContentType // io.ktor.http/ContentType.Application.Xml_Dtd.|(){}[0] + final val Yaml // io.ktor.http/ContentType.Application.Yaml|{}Yaml[0] + final fun (): io.ktor.http/ContentType // io.ktor.http/ContentType.Application.Yaml.|(){}[0] final val Zip // io.ktor.http/ContentType.Application.Zip|{}Zip[0] final fun (): io.ktor.http/ContentType // io.ktor.http/ContentType.Application.Zip.|(){}[0] } diff --git a/ktor-http/common/src/io/ktor/http/ContentTypes.kt b/ktor-http/common/src/io/ktor/http/ContentTypes.kt index 117c423d90e..ca02d62430f 100644 --- a/ktor-http/common/src/io/ktor/http/ContentTypes.kt +++ b/ktor-http/common/src/io/ktor/http/ContentTypes.kt @@ -176,6 +176,7 @@ public class ContentType private constructor( public val Soap: ContentType = ContentType("application", "soap+xml") public val Xml: ContentType = ContentType("application", "xml") public val Xml_Dtd: ContentType = ContentType("application", "xml-dtd") + public val Yaml: ContentType = ContentType("application", "yaml") public val Zip: ContentType = ContentType("application", "zip") public val GZip: ContentType = ContentType("application", "gzip") diff --git a/ktor-http/common/src/io/ktor/http/Mimes.kt b/ktor-http/common/src/io/ktor/http/Mimes.kt index 4e9d52f09b7..063fdf01ae6 100644 --- a/ktor-http/common/src/io/ktor/http/Mimes.kt +++ b/ktor-http/common/src/io/ktor/http/Mimes.kt @@ -6,7 +6,7 @@ package io.ktor.http import io.ktor.util.* -internal const val INITIAL_MIMES_LIST_SIZE: Int = 1212 +internal const val INITIAL_MIMES_LIST_SIZE: Int = 1215 private val rawMimes: String get() = """ @@ -688,6 +688,8 @@ application/xslt+xml,xslt application/xspf+xml,xspf application/xv+xml,mxml application/yang,yang +application/yaml,yaml +application/x-yaml,yaml application/yin+xml,yin application/zip,war audio/aac,aac @@ -915,6 +917,7 @@ text/x-vcalendar,vcs text/x-vcard,vcf text/xml,xml text/yaml,yaml +text/x-yaml,yaml video/3gpp,3gp video/3gpp2,3g2 video/animaflex,afl diff --git a/ktor-server/ktor-server-plugins/ktor-server-swagger/jvm/test/io/ktor/server/plugins/swagger/SwaggerTest.kt b/ktor-server/ktor-server-plugins/ktor-server-swagger/jvm/test/io/ktor/server/plugins/swagger/SwaggerTest.kt index e1be3a61d0e..e8a451eba86 100644 --- a/ktor-server/ktor-server-plugins/ktor-server-swagger/jvm/test/io/ktor/server/plugins/swagger/SwaggerTest.kt +++ b/ktor-server/ktor-server-plugins/ktor-server-swagger/jvm/test/io/ktor/server/plugins/swagger/SwaggerTest.kt @@ -101,7 +101,7 @@ class SwaggerTest { val response = client.get("/openapi/documentation.yaml") val body = response.bodyAsText() - assertEquals("text/yaml; charset=UTF-8", response.contentType().toString()) + assertEquals("application/yaml", response.contentType().toString()) assertEquals("hello:\n world".filter { it.isLetterOrDigit() }, body.filter { it.isLetterOrDigit() }) }