mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-04-24 06:39:33 +08:00
Hot fix for Surge HTTP 2.0 feature
This commit is contained in:
parent
97de476ae3
commit
051a01efb0
2
backend/dist/sub-store-parser.loon.min.js
vendored
2
backend/dist/sub-store-parser.loon.min.js
vendored
@ -6,7 +6,7 @@
|
||||
* ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗
|
||||
* ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
||||
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
|
||||
* @updated: 2022/6/13 14:20:20
|
||||
* @updated: 2022/6/14 23:51:44
|
||||
* @version: 1.6
|
||||
* @author: Peng-YM
|
||||
* @github: https://github.com/Peng-YM/Sub-Store
|
||||
|
11
backend/src/vendor/express.js
vendored
11
backend/src/vendor/express.js
vendored
@ -54,7 +54,8 @@ export default function express({ substore: $, port }) {
|
||||
// dispatch url to route
|
||||
const dispatch = (request, start = 0) => {
|
||||
let { method, url, headers, body } = request;
|
||||
if (/json/i.test(headers['Content-Type'])) {
|
||||
headers = formatHeaders(headers);
|
||||
if (/json/i.test(headers['content-type'])) {
|
||||
body = JSON.parse(body);
|
||||
}
|
||||
|
||||
@ -214,6 +215,14 @@ export default function express({ substore: $, port }) {
|
||||
}
|
||||
}
|
||||
|
||||
function formatHeaders(headers) {
|
||||
const result = {};
|
||||
for (const k of Object.keys(headers)) {
|
||||
result[k.toLowerCase()] = headers[k];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function patternMatched(pattern, path) {
|
||||
if (pattern instanceof RegExp && pattern.test(path)) {
|
||||
return true;
|
||||
|
4
backend/sub-store.min.js
vendored
4
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user