diff --git a/pkg/serving/test.go b/pkg/serving/test.go index 88ca7e7e34..7fb4782fed 100644 --- a/pkg/serving/test.go +++ b/pkg/serving/test.go @@ -167,8 +167,144 @@ func validateServingExampleInput(help *HelpResponse, input map[string]string) er func extensionByType(mimeType string) string { switch mimeType { + case "audio/aac": + return ".aac" + case "application/x-abiword": + return ".abw" + case "application/x-freearc": + return ".arc" + case "video/x-msvideo": + return ".avi" + case "application/vnd.amazon.ebook": + return ".azw" + case "application/octet-stream": + return ".bin" + case "image/bmp": + return ".bmp" + case "application/x-bzip": + return ".bz" + case "application/x-bzip2": + return ".bz2" + case "application/x-csh": + return ".csh" + case "text/css": + return ".css" + case "text/csv": + return ".csv" + case "application/msword": + return ".doc" + case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": + return ".docx" + case "application/vnd.ms-fontobject": + return ".eot" + case "application/epub+zip": + return ".epub" + case "application/gzip": + return ".gz" + case "image/gif": + return ".gif" + case "text/html": + return ".html" + case "image/vnd.microsoft.icon": + return ".ico" + case "text/calendar": + return ".ics" + case "application/java-archive": + return ".jar" + case "image/jpeg": + return ".jpg" + case "text/javascript": + return ".js" + case "application/json": + return ".json" + case "application/ld+json": + return ".jsonld" + case "audio/midi audio/x-midi": + return ".midi" + case "audio/mpeg": + return ".mp3" + case "application/x-cdf": + return ".cda" + case "video/mp4": + return ".mp4" + case "video/mpeg": + return ".mpeg" + case "application/vnd.apple.installer+xml": + return ".mpkg" + case "application/vnd.oasis.opendocument.presentation": + return ".odp" + case "application/vnd.oasis.opendocument.spreadsheet": + return ".ods" + case "application/vnd.oasis.opendocument.text": + return ".odt" + case "audio/ogg": + return ".oga" + case "video/ogg": + return ".ogv" + case "application/ogg": + return ".ogx" + case "audio/opus": + return ".opus" + case "font/otf": + return ".otf" + case "image/png": + return ".png" + case "application/pdf": + return ".pdf" + case "application/x-httpd-php": + return ".php" + case "application/vnd.ms-powerpoint": + return ".ppt" + case "application/vnd.openxmlformats-officedocument.presentationml.presentation": + return ".pptx" + case "application/vnd.rar": + return ".rar" + case "application/rtf": + return ".rtf" + case "application/x-sh": + return ".sh" + case "image/svg+xml": + return ".svg" + case "application/x-shockwave-flash": + return ".swf" + case "application/x-tar": + return ".tar" + case "image/tiff": + return ".tiff" + case "video/mp2t": + return ".ts" + case "font/ttf": + return ".ttf" case "text/plain": return ".txt" + case "application/vnd.visio": + return ".vsd" + case "audio/wav": + return ".wav" + case "audio/webm": + return ".weba" + case "video/webm": + return ".webm" + case "image/webp": + return ".webp" + case "font/woff": + return ".woff" + case "font/woff2": + return ".woff2" + case "application/xhtml+xml": + return ".xhtml" + case "application/vnd.ms-excel": + return ".xls" + case "application/xml": + return ".xml" + case "application/zip": + return ".zip" + case "video/3gpp": + return ".3gp" + case "video/3gpp2": + return ".3gp2" + case "application/x-7z-compressed": + return ".7z" default: extensions, _ := mime.ExtensionsByType(mimeType) if extensions == nil || len(extensions) == 0 {