修复直接下载header

经查阅以及实践,确定nginx与apache的header写反了。
pull/398/head
时光 2019-11-29 10:08:13 +08:00 committed by GitHub
parent c25eeab991
commit e543e0ec4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1042,9 +1042,9 @@ function file_put_out($file,$download=-1,$downFilename=false){
$server = strtolower($_SERVER['SERVER_SOFTWARE']);
if($server && $GLOBALS['config']['settings']['httpSendFile']){
if(strstr($server,'nginx')){//nginx
header("X-Sendfile: ".$file);
}else if(strstr($server,'apache')){ //apache
header('X-Accel-Redirect: '.$file);
}else if(strstr($server,'apache')){ //apache
header("X-Sendfile: ".$file);
}else if(strstr($server,'http')){//light http
header( "X-LIGHTTPD-send-file: " . $file);
}
@ -1447,4 +1447,4 @@ function write_log($log, $type = 'default', $level = 'log'){
}
clearstatcache();
return error_log("$now_time $log\n", 3, $target);
}
}