|
@@ -58,12 +58,20 @@ namespace Rac.Models
|
|
|
|
|
|
public bool GetCss(out string css)
|
|
public bool GetCss(out string css)
|
|
{
|
|
{
|
|
- var ct = new ContentType(ContentType);
|
|
|
|
|
|
+ var contentType = ContentType;
|
|
|
|
+ if (null == contentType)
|
|
|
|
+ {
|
|
|
|
+ css = null;
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var ct = new ContentType(contentType);
|
|
if (ct.MediaType != "text/css")
|
|
if (ct.MediaType != "text/css")
|
|
{
|
|
{
|
|
css = null;
|
|
css = null;
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+
|
|
var enc = Encoding.GetEncoding(ct.CharSet ?? "utf-8");
|
|
var enc = Encoding.GetEncoding(ct.CharSet ?? "utf-8");
|
|
css = enc.GetString(Body);
|
|
css = enc.GetString(Body);
|
|
return true;
|
|
return true;
|
|
@@ -80,4 +88,4 @@ namespace Rac.Models
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|