Chrome and Firefox don't render Font-Awesome's WOFF/TTF, even if they download them from HttpListener, that said, Safari on iOS is rendering Font-Awesome correctly. I am sending HTTP response using .NET's HttpListener class as follows:
private void Send(HttpListenerContext context, byte[] response, string contentType)
{
context.Response.StatusCode = (int)HttpStatusCode.OK;
context.Response.ContentEncoding = Encoding.UTF8;
context.Response.ContentType = contentType;
context.Response.ContentLength64 = response.Length;
context.Response.AddHeader("Server", SERVER);
if (response == null || response.Length == 0)
{
logger.Error("Send: Engine generated null or empty content");
context.Response.StatusCode = (int)HttpStatusCode.NotFound;
return;
}
using (var s = context.Response.OutputStream)
{
s.Write(response, 0, response.Length);
}
}
Is there another encoding type (other than UTF8) for WOFF? or is there something that I have to take care of in Chrome or Firefox?
Any help or pointer appreciated, thanks.
In my own implementation, I leave out the ContentEncoding header all together when serving a font or binary.
This should work: