media, output: Add CSV type and format

And make CSS correclty behave as plain text.
This commit is contained in:
Bjørn Erik Pedersen
2017-04-01 15:12:31 +02:00
parent 05949c9038
commit f911b107ef
4 changed files with 30 additions and 6 deletions

View File

@@ -49,6 +49,7 @@ func (m Type) String() string {
var (
CalendarType = Type{"text", "calendar", "ics"}
CSSType = Type{"text", "css", "css"}
CSVType = Type{"text", "csv", "csv"}
HTMLType = Type{"text", "html", "html"}
JavascriptType = Type{"application", "javascript", "js"}
JSONType = Type{"application", "json", "json"}

View File

@@ -30,6 +30,7 @@ func TestDefaultTypes(t *testing.T) {
}{
{CalendarType, "text", "calendar", "ics", "text/calendar", "text/calendar+ics"},
{CSSType, "text", "css", "css", "text/css", "text/css+css"},
{CSVType, "text", "csv", "csv", "text/csv", "text/csv+csv"},
{HTMLType, "text", "html", "html", "text/html", "text/html+html"},
{JavascriptType, "application", "javascript", "js", "application/javascript", "application/javascript+js"},
{JSONType, "application", "json", "json", "application/json", "application/json+json"},