php proxy woff font using fpassthru -
hi trying proxy woff font file using php
this code using $path path file on harddisk. error in console
failed decode downloaded font: http://localhost/font/fontawesome-webfont.woff?v=3.2.1 fakemboard.com/:1 ots parsing error: invalid version tag
if use phpstorm default http server works fine.
i have attached 2 images:
1) first problematic response php proxy
2) second 1 ok 1 using phpstorm default server
can me find out missing proxy? believe may headers buy weak @ that. helpful if provide missing code. thanks
header('content-type: application/font-woff'); $file = fopen($path, 'rb'); if ($file) { fpassthru($file); exit; }
i flowed mike 'pomax' kamermans advice , compered file font file bad font file. indeed different. bad file has 2 blank lines in beginning.
it happened because in 1 of php files have included accidentally added blank lines before <?php
tag , php rendered them. hope helps else
Comments
Post a Comment