diff --git a/lib/network/http/content_type.dart b/lib/network/http/content_type.dart index 956c3fc..202fe95 100644 --- a/lib/network/http/content_type.dart +++ b/lib/network/http/content_type.dart @@ -49,6 +49,8 @@ class MediaType { static List defaultCharsetMediaTypes = [ MediaType("text", "plain", charset: "utf-8"), MediaType("text", "html", charset: "utf-8"), + MediaType("text", "javascript", charset: "utf-8"), + MediaType("text", "css", charset: "utf-8"), MediaType("application", "json", charset: "utf-8"), MediaType("application", "problem+json", charset: "utf-8"), MediaType("application", "xml", charset: "utf-8"), @@ -61,9 +63,10 @@ class MediaType { final String subtype; final Map parameters; - MediaType(this.type, this.subtype, {this.parameters = const {}, String? charset}) { + MediaType(this.type, this.subtype, {Map? parameters, String? charset}) + : parameters = parameters ?? {} { if (charset != null) { - parameters["charset"] = charset; + this.parameters["charset"] = charset; } } diff --git a/lib/network/http/http.dart b/lib/network/http/http.dart index 367eb2d..947744b 100644 --- a/lib/network/http/http.dart +++ b/lib/network/http/http.dart @@ -83,7 +83,7 @@ abstract class HttpMessage { String? get charset { var contentType = headers.contentType; if (contentType.isEmpty) { - return null; + return 'utf-8'; } MediaType mediaType = MediaType.valueOf(contentType); diff --git a/linux/build.sh b/linux/build.sh index bc4a262..f95b290 100644 --- a/linux/build.sh +++ b/linux/build.sh @@ -1,5 +1,6 @@ #!/bin/bash + pwd cd ../build/linux/x64/release rm -rf package