diff --git a/model/src/main/kotlin/io/kotless/HTTP.kt b/model/src/main/kotlin/io/kotless/HTTP.kt index 598571f4..fccdeaa3 100644 --- a/model/src/main/kotlin/io/kotless/HTTP.kt +++ b/model/src/main/kotlin/io/kotless/HTTP.kt @@ -20,22 +20,45 @@ enum class MimeType(val mimeText: String, val isBinary: Boolean, val extension: MARKDOWN("text/markdown", false, "md"), HTML("text/html", false, "html"), CSS("text/css", false, "css"), + CSV("text/csv", false, "csv"), + ICS("text/calendar", false, "ics"), PNG("image/png", true, "png"), APNG("image/apng", true, "apng"), GIF("image/gif", true, "gif"), - SVG("image/svg", true, "svg"), + SVG("image/svg+xml", false, "svg"), JPEG("image/jpeg", true, "jpeg"), + HEIC("image/heic", true, "heic"), + ICO("image/vnd.microsoft.icon", true, "ico"), BMP("image/bmp", true, "bmp"), + MPEG("audio/mpeg",true, "mp3"), + M4A("audio/mp4", true, "m4a"), + MP4("video/mp4", true, "mp4"), + AAC("audio/aac", true, "aac"), WEBP("image/webp", true, "webp"), + WEBA("audio/webm", true, "weba"), + WEBM("video/webm", true, "webm"), TTF("font/ttf", true, "ttf"), + WOFF("font/woff", true, "woff"), + WOFF2("font/woff2", true, "woff2"), + + DOC("application/msword",true, "doc"), + DOCX("application/vnd.openxmlformats-officedocument.wordprocessingml.document",true, "docx"), + PPT("application/vnd.ms-powerpoint",true,"ppt"), + PPTX("application/vnd.openxmlformats-officedocument.presentationml.presentation", true, "pptx"), + XLS("application/vnd.ms-excel", true, "xls"), + XLSX("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", true, "xlsx"), + PDF("application/pdf", true, "pdf"), + EPUB("application/epub+zip",true, "epub"), JS("application/javascript", false, "js"), JSMAP("application/json", false, "map"), JSON("application/json", false, "json"), XML("application/xml", false, "xml"), + SHELL("application/x-shellscript", false,"sh"), + JAR("application/java-archive", true, "jar"), ZIP("application/zip", true, "zip"), - GZIP("application/gzip", true, "gzip"); + GZIP("application/gzip", true, "gz"); companion object { fun binary() = values().filter { it.isBinary }.toTypedArray() diff --git a/plugins/gradle/src/test/resources/examples/kotless/shortener/shortener.tf b/plugins/gradle/src/test/resources/examples/kotless/shortener/shortener.tf index 0464e87f..570d4836 100644 --- a/plugins/gradle/src/test/resources/examples/kotless/shortener/shortener.tf +++ b/plugins/gradle/src/test/resources/examples/kotless/shortener/shortener.tf @@ -268,7 +268,7 @@ resource "aws_api_gateway_resource" "shorten" { } resource "aws_api_gateway_rest_api" "shortener" { - binary_media_types = ["application/gzip", "application/zip", "font/ttf", "image/apng", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg", "image/webp"] + binary_media_types = ["application/epub+zip", "application/gzip", "application/java-archive", "application/msword", "application/pdf", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/zip", "audio/aac", "audio/mp4", "audio/mpeg", "audio/webm", "font/ttf", "font/woff", "font/woff2", "image/apng", "image/bmp", "image/gif", "image/heic", "image/jpeg", "image/png", "image/vnd.microsoft.icon", "image/webp", "video/mp4", "video/webm"] name = "short-shortener" } diff --git a/plugins/gradle/src/test/resources/examples/kotless/site/site.tf b/plugins/gradle/src/test/resources/examples/kotless/site/site.tf index 28b2c4dd..df29965a 100644 --- a/plugins/gradle/src/test/resources/examples/kotless/site/site.tf +++ b/plugins/gradle/src/test/resources/examples/kotless/site/site.tf @@ -564,7 +564,7 @@ resource "aws_api_gateway_resource" "pages_plugin_tasks" { } resource "aws_api_gateway_rest_api" "site" { - binary_media_types = ["application/gzip", "application/zip", "font/ttf", "image/apng", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg", "image/webp"] + binary_media_types = ["application/epub+zip", "application/gzip", "application/java-archive", "application/msword", "application/pdf", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/zip", "audio/aac", "audio/mp4", "audio/mpeg", "audio/webm", "font/ttf", "font/woff", "font/woff2", "image/apng", "image/bmp", "image/gif", "image/heic", "image/jpeg", "image/png", "image/vnd.microsoft.icon", "image/webp", "video/mp4", "video/webm"] name = "site-site" } diff --git a/plugins/gradle/src/test/resources/examples/ktor/shortener/shortener.tf b/plugins/gradle/src/test/resources/examples/ktor/shortener/shortener.tf index d795a355..09dabb57 100644 --- a/plugins/gradle/src/test/resources/examples/ktor/shortener/shortener.tf +++ b/plugins/gradle/src/test/resources/examples/ktor/shortener/shortener.tf @@ -268,7 +268,7 @@ resource "aws_api_gateway_resource" "shorten" { } resource "aws_api_gateway_rest_api" "shortener" { - binary_media_types = ["application/gzip", "application/zip", "font/ttf", "image/apng", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg", "image/webp"] + binary_media_types = ["application/epub+zip", "application/gzip", "application/java-archive", "application/msword", "application/pdf", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/zip", "audio/aac", "audio/mp4", "audio/mpeg", "audio/webm", "font/ttf", "font/woff", "font/woff2", "image/apng", "image/bmp", "image/gif", "image/heic", "image/jpeg", "image/png", "image/vnd.microsoft.icon", "image/webp", "video/mp4", "video/webm"] name = "ktor-short-shortener" } diff --git a/plugins/gradle/src/test/resources/examples/ktor/site/site.tf b/plugins/gradle/src/test/resources/examples/ktor/site/site.tf index 011db46d..f2c08f55 100644 --- a/plugins/gradle/src/test/resources/examples/ktor/site/site.tf +++ b/plugins/gradle/src/test/resources/examples/ktor/site/site.tf @@ -564,7 +564,7 @@ resource "aws_api_gateway_resource" "pages_plugin_tasks" { } resource "aws_api_gateway_rest_api" "site" { - binary_media_types = ["application/gzip", "application/zip", "font/ttf", "image/apng", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg", "image/webp"] + binary_media_types = ["application/epub+zip", "application/gzip", "application/java-archive", "application/msword", "application/pdf", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/zip", "audio/aac", "audio/mp4", "audio/mpeg", "audio/webm", "font/ttf", "font/woff", "font/woff2", "image/apng", "image/bmp", "image/gif", "image/heic", "image/jpeg", "image/png", "image/vnd.microsoft.icon", "image/webp", "video/mp4", "video/webm"] name = "ktor-site-site" } diff --git a/plugins/gradle/src/test/resources/examples/spring/shortener/shortener.tf b/plugins/gradle/src/test/resources/examples/spring/shortener/shortener.tf index f67c865d..170ae5e0 100644 --- a/plugins/gradle/src/test/resources/examples/spring/shortener/shortener.tf +++ b/plugins/gradle/src/test/resources/examples/spring/shortener/shortener.tf @@ -268,7 +268,7 @@ resource "aws_api_gateway_resource" "shorten" { } resource "aws_api_gateway_rest_api" "shortener" { - binary_media_types = ["application/gzip", "application/zip", "font/ttf", "image/apng", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg", "image/webp"] + binary_media_types = ["application/epub+zip", "application/gzip", "application/java-archive", "application/msword", "application/pdf", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/zip", "audio/aac", "audio/mp4", "audio/mpeg", "audio/webm", "font/ttf", "font/woff", "font/woff2", "image/apng", "image/bmp", "image/gif", "image/heic", "image/jpeg", "image/png", "image/vnd.microsoft.icon", "image/webp", "video/mp4", "video/webm"] name = "spring-short-shortener" } diff --git a/plugins/gradle/src/test/resources/examples/spring/site/site.tf b/plugins/gradle/src/test/resources/examples/spring/site/site.tf index 820c5afe..a747a3c5 100644 --- a/plugins/gradle/src/test/resources/examples/spring/site/site.tf +++ b/plugins/gradle/src/test/resources/examples/spring/site/site.tf @@ -564,7 +564,7 @@ resource "aws_api_gateway_resource" "pages_plugin_tasks" { } resource "aws_api_gateway_rest_api" "site" { - binary_media_types = ["application/gzip", "application/zip", "font/ttf", "image/apng", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg", "image/webp"] + binary_media_types = ["application/epub+zip", "application/gzip", "application/java-archive", "application/msword", "application/pdf", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/zip", "audio/aac", "audio/mp4", "audio/mpeg", "audio/webm", "font/ttf", "font/woff", "font/woff2", "image/apng", "image/bmp", "image/gif", "image/heic", "image/jpeg", "image/png", "image/vnd.microsoft.icon", "image/webp", "video/mp4", "video/webm"] name = "spring-site-site" }