mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 08:19:01 +08:00
feat: support HEAD method
This commit is contained in:
parent
26e83798da
commit
93a1ba7b50
7
backend/src/vendor/open-api.js
vendored
7
backend/src/vendor/open-api.js
vendored
@ -376,12 +376,17 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
|
|||||||
worker = new Promise(async (resolve, reject) => {
|
worker = new Promise(async (resolve, reject) => {
|
||||||
const requestHandler = {
|
const requestHandler = {
|
||||||
get: $Plugins.HttpGet,
|
get: $Plugins.HttpGet,
|
||||||
|
head: $Plugins.HttpHead,
|
||||||
post: $Plugins.HttpPost,
|
post: $Plugins.HttpPost,
|
||||||
put: $Plugins.HttpPut,
|
put: $Plugins.HttpPut,
|
||||||
delete: $Plugins.HttpDelete,
|
delete: $Plugins.HttpDelete,
|
||||||
};
|
};
|
||||||
const request = requestHandler[method.toLowerCase()];
|
const request = requestHandler[method.toLowerCase()];
|
||||||
if (!request) reject('GUI.for.Cores未实现当前方法:' + method);
|
if (!request)
|
||||||
|
reject(
|
||||||
|
'[GUI.for.Cores] This method is not implemented: ' +
|
||||||
|
method,
|
||||||
|
);
|
||||||
try {
|
try {
|
||||||
const { url, headers } = options;
|
const { url, headers } = options;
|
||||||
const response = await request(url, headers, options.body);
|
const response = await request(url, headers, options.body);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user