修复Loon和Surge上无法保存的bug

This commit is contained in:
Peng-YM 2020-11-24 22:59:04 +08:00
parent f9dd77ed41
commit 710d5b14e5
2 changed files with 8 additions and 14 deletions

View File

@ -64,10 +64,6 @@ function service() {
// gist backup // gist backup
$app.get("/api/backup"); $app.get("/api/backup");
$app.all("/", (req, res) => {
res.status(405).end();
});
// Storage management // Storage management
$app.route("/api/storage") $app.route("/api/storage")
.get((req, res) => { .get((req, res) => {
@ -96,12 +92,10 @@ function service() {
res.set("location", "https://sub-store.vercel.app/").status(302).end(); res.set("location", "https://sub-store.vercel.app/").status(302).end();
}); });
// handle preflight request for QX // handle preflight request
if (ENV().isQX) {
$app.options("/", async (req, res) => { $app.options("/", async (req, res) => {
res.status(200).end(); res.status(200).end();
}); });
}
$app.all("/", (req, res) => { $app.all("/", (req, res) => {
res.send("Hello from sub-store, made with ❤️ by Peng-YM"); res.send("Hello from sub-store, made with ❤️ by Peng-YM");
@ -2951,7 +2945,7 @@ function Gist(backupKey, token) {
* Mini Express Framework * Mini Express Framework
* https://github.com/Peng-YM/QuanX/blob/master/Tools/OpenAPI/Express.js * https://github.com/Peng-YM/QuanX/blob/master/Tools/OpenAPI/Express.js
*/ */
function express(port = 3000) { function express({port} = {port: 3000}) {
const {isNode} = ENV(); const {isNode} = ENV();
const DEFAULT_HEADERS = { const DEFAULT_HEADERS = {
"Content-Type": "text/plain;charset=UTF-8", "Content-Type": "text/plain;charset=UTF-8",
@ -3008,7 +3002,7 @@ function express(port = 3000) {
method = method.toUpperCase(); method = method.toUpperCase();
const {path, query} = extractURL(url); const {path, query} = extractURL(url);
// path matching // pattern match
let handler = null; let handler = null;
let i; let i;
let longestMatchedPattern = 0; let longestMatchedPattern = 0;

File diff suppressed because one or more lines are too long