commit
adf31f9e44
16
common.php
16
common.php
|
@ -59,6 +59,8 @@ $EnvConfigs = [
|
||||||
'guestup_path' => 0b111,
|
'guestup_path' => 0b111,
|
||||||
'domainforproxy' => 0b111,
|
'domainforproxy' => 0b111,
|
||||||
'public_path' => 0b111,
|
'public_path' => 0b111,
|
||||||
|
'fileConduitSize' => 0b110,
|
||||||
|
'fileConduitCacheTime' => 0b110,
|
||||||
];
|
];
|
||||||
|
|
||||||
$timezones = array(
|
$timezones = array(
|
||||||
|
@ -392,6 +394,20 @@ function main($path)
|
||||||
$url = $files['url'];
|
$url = $files['url'];
|
||||||
if ( strtolower(splitlast($files['name'], '.')[1])=='html' ) return output($files['content']['body'], $files['content']['stat']);
|
if ( strtolower(splitlast($files['name'], '.')[1])=='html' ) return output($files['content']['body'], $files['content']['stat']);
|
||||||
else {
|
else {
|
||||||
|
$fileConduitSize = getConfig('fileConduitSize', $_SERVER['disktag']);
|
||||||
|
$fileConduitCacheTime = getConfig('fileConduitCacheTime', $_SERVER['disktag']);
|
||||||
|
if (!!$fileConduitSize || !!$fileConduitCacheTime) {
|
||||||
|
if ($fileConduitSize>1) $fileConduitSize *= 1024*1024;
|
||||||
|
else $fileConduitSize = 1024*1024;
|
||||||
|
if ($fileConduitCacheTime>1) $fileConduitCacheTime *= 3600;
|
||||||
|
else $fileConduitCacheTime = 3600;
|
||||||
|
if ($files['size']<$fileConduitSize) return output(
|
||||||
|
base64_encode(file_get_contents($files['url'])),
|
||||||
|
200,
|
||||||
|
['Content-Type' => $files['mime'], 'Cache-Control' => 'max-age=' . $fileConduitCacheTime],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
if ($_SERVER['HTTP_RANGE']!='') $header['Range'] = $_SERVER['HTTP_RANGE'];
|
if ($_SERVER['HTTP_RANGE']!='') $header['Range'] = $_SERVER['HTTP_RANGE'];
|
||||||
$header['Location'] = $url;
|
$header['Location'] = $url;
|
||||||
$domainforproxy = '';
|
$domainforproxy = '';
|
||||||
|
|
|
@ -30,7 +30,8 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||||
header($headerName . ': ' . $headerVal, true);
|
header($headerName . ': ' . $headerVal, true);
|
||||||
}
|
}
|
||||||
http_response_code($re['statusCode']);
|
http_response_code($re['statusCode']);
|
||||||
echo $re['body'];
|
if ($re['isBase64Encoded']) echo base64_decode($re['body']);
|
||||||
|
else echo $re['body'];
|
||||||
} elseif (isset($_SERVER['DOCUMENT_ROOT'])&&$_SERVER['DOCUMENT_ROOT']==='/var/task/user') {
|
} elseif (isset($_SERVER['DOCUMENT_ROOT'])&&$_SERVER['DOCUMENT_ROOT']==='/var/task/user') {
|
||||||
if (getenv('ONEMANAGER_CONFIG_SAVE')=='env') include 'platform/Vercel_env.php';
|
if (getenv('ONEMANAGER_CONFIG_SAVE')=='env') include 'platform/Vercel_env.php';
|
||||||
else include 'platform/Vercel.php';
|
else include 'platform/Vercel.php';
|
||||||
|
@ -44,7 +45,8 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||||
header($headerName . ': ' . $headerVal, true);
|
header($headerName . ': ' . $headerVal, true);
|
||||||
}
|
}
|
||||||
http_response_code($re['statusCode']);
|
http_response_code($re['statusCode']);
|
||||||
echo $re['body'];
|
if ($re['isBase64Encoded']) echo base64_decode($re['body']);
|
||||||
|
else echo $re['body'];
|
||||||
} else {
|
} else {
|
||||||
include 'platform/Normal.php';
|
include 'platform/Normal.php';
|
||||||
$path = getpath();
|
$path = getpath();
|
||||||
|
@ -58,7 +60,8 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||||
header($headerName . ': ' . $headerVal, true);
|
header($headerName . ': ' . $headerVal, true);
|
||||||
}
|
}
|
||||||
http_response_code($re['statusCode']);
|
http_response_code($re['statusCode']);
|
||||||
echo $re['body'];
|
if ($re['isBase64Encoded']) echo base64_decode($re['body']);
|
||||||
|
else echo $re['body'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tencent SCF
|
// Tencent SCF
|
||||||
|
|
|
@ -601,12 +601,12 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addVideos(['<!--FileEncodeUrl-->']);
|
addVideos(["<!--FileEncodeUrl-->"]);
|
||||||
<!--IsvideoFileEnd-->
|
<!--IsvideoFileEnd-->
|
||||||
<!--IspdfFileStart-->
|
<!--IspdfFileStart-->
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
|
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.bootcss.com/pdf.js/2.3.200/pdf.worker.min.js';
|
||||||
var loadingTask = pdfjsLib.getDocument({
|
var loadingTask = pdfjsLib.getDocument({
|
||||||
url: '<!--FileDownUrl-->',
|
url: "<!--FileDownUrl-->",
|
||||||
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
|
cMapUrl: "//cdn.jsdelivr.net/npm/pdfjs-dist@2.2.228/cmaps/",
|
||||||
cMapPacked: true,
|
cMapPacked: true,
|
||||||
rangeChunkSize: 65535
|
rangeChunkSize: 65535
|
||||||
|
|
Loading…
Reference in New Issue