Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update size limit of files #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion serverless.component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wordpress
version: 0.2.3
version: 0.2.5
author: Tencent Cloud, Inc.
org: Tencent Cloud, Inc.
description: Deploy a serverless wordpress.js application on Tencent SCF and API Gateway.
Expand Down
14 changes: 13 additions & 1 deletion src/_shims/handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function active_mysql_connect()
"swf" => "video/mpeg4",
"tif" => "image/tiff",
"tiff" => "image/tiff",
"ttf" => "application/x-font-ttf",
"vcf" => "text/x-vcard",
"wav" => "audio/wav",
"wma" => "audio/x-ms-wma",
Expand All @@ -69,7 +70,6 @@ function active_mysql_connect()
"torrent" => "application/x-bittorrent",
);


$request_uri = explode("?", $_SERVER['REQUEST_URI']);
$local_file_path = $_SERVER['DOCUMENT_ROOT'] . urldecode($request_uri[0]);

Expand Down Expand Up @@ -100,15 +100,27 @@ function active_mysql_connect()
}
fclose($fp);
} elseif ( $extension == "php" && file_exists( $local_file_path ) ) {
header('Cache-Control:no-cache,must-revalidate');
header('Pragma:no-cache');
header("Expires:0");

header("X-ExecFile: {$local_file_path}");
require( $local_file_path );

} elseif ( substr($local_file_path, -1) == "/" && file_exists( $local_file_path . "index.php" ) ) {
header('Cache-Control:no-cache,must-revalidate');
header('Pragma:no-cache');
header("Expires:0");

$exec_file_path = $local_file_path . "index.php";
header("X-ExecFile: {$exec_file_path}");
require( $exec_file_path );

} else {
header('Cache-Control:no-cache,must-revalidate');
header('Pragma:no-cache');
header("Expires:0");

$exec_file_path = dirname(__FILE__) . '/index.php';
header("X-ExecFile: {$exec_file_path}");
require( $exec_file_path );
Expand Down
3 changes: 1 addition & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ const CONFIGS = {
runtime: 'Nodejs12.16',
handler: 'sl_handler.handler',
cfsMountDir: '/mnt',
timeout: 120,
initTimeout: 3
timeout: 120
},

// wp-server 函数配置
Expand Down
Binary file modified src/fixtures/layer/wp-layer.zip
Binary file not shown.