CNode

这样写不对么?不能成功

Ssmilingxinyi发布于12 年前最后回复12 年前4 回复3905 浏览0 收藏

if(decodeURI(url.parse(req.url).pathname)=="/方正卡通简体.ttf"){ fs.readFile("./方正卡通简体.ttf",Buffer,function(err,data){ zlib.gzip(data, function(err,buffer){ if(!err){ res.writeHead(200,{'Content-Type':"application/x-font-ttf","Content-Length":data.length,"Accept-Encoding":'gzip'}); res.end(buffer,"binary"); } else{ console.log(err); } }) }) }

不能用 TAT

查看回复

回复 (4)

N
nihgwu#1·12 年前

没有用框架?

M
MiguelValentine#2·12 年前

head里用标准的下载头部。不要用TTF头。

S
smilingxinyi#3·12 年前
引用 MiguelValentinehead里用标准的下载头部。不要用TTF头。

@MiguelValentine 好的。。我试试,多谢

S
smilingxinyi#4·12 年前
引用 nihgwu没有用框架?

@nihgwu 没。一个小demo没必咩- -

参与回复
登录后即可参与回复。登录