use of lucee.commons.io.res.ContentType in project Lucee by lucee.
the class ExecutionThread method isText.
private static boolean isText(HTTPResponse rsp) {
ContentType ct = rsp.getContentType();
if (ct == null)
return true;
String mimetype = ct.getMimeType();
return mimetype == null || mimetype.startsWith("text") || mimetype.startsWith("application/octet-stream");
}
use of lucee.commons.io.res.ContentType in project Lucee by lucee.
the class HTTPResponseSupport method getCharset.
@Override
public final String getCharset() {
ContentType ct = getContentType();
String charset = null;
if (ct != null)
charset = ct.getCharset();
if (!StringUtil.isEmpty(charset))
return charset;
PageContext pc = ThreadLocalPageContext.get();
if (pc != null)
return pc.getWebCharset().name();
return "ISO-8859-1";
}
Aggregations