跳到主要内容
CNode

这样写不对么?不能成功

社区
Ssmilingxinyi发布于 12 年前最后回复 12 年前
439280

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)

S
smilingxinyi#412 年前
引用 nihgwu没有用框架?

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

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

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

M
MiguelValentine#212 年前

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

N
nihgwu#112 年前

没有用框架?

参与回复

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