From 93a1ba7b5059b6f64323d837417df3675e15b076 Mon Sep 17 00:00:00 2001 From: onejibang Date: Mon, 13 May 2024 19:12:22 +0800 Subject: [PATCH] feat: support HEAD method --- backend/src/vendor/open-api.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/vendor/open-api.js b/backend/src/vendor/open-api.js index 3283dfb..174fded 100644 --- a/backend/src/vendor/open-api.js +++ b/backend/src/vendor/open-api.js @@ -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);