mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 07: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) => {
|
||||
const requestHandler = {
|
||||
get: $Plugins.HttpGet,
|
||||
head: $Plugins.HttpHead,
|
||||
post: $Plugins.HttpPost,
|
||||
put: $Plugins.HttpPut,
|
||||
delete: $Plugins.HttpDelete,
|
||||
};
|
||||
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 {
|
||||
const { url, headers } = options;
|
||||
const response = await request(url, headers, options.body);
|
||||
|
Loading…
x
Reference in New Issue
Block a user