dsh-bottom-info-bar 1.27.2 → 1.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +8 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -5496,6 +5496,11 @@ export default {
|
|
|
5496
5496
|
// Origin/Host headers and adds its private Host cookie. requestRejection() is the shared
|
|
5497
5497
|
// boundary for both Web and Desktop; reproducing the browser-header check here rejects
|
|
5498
5498
|
// legitimate desktop requests.
|
|
5499
|
+
// DSH 0.2.3 起 Connection 重构移除了 requestRejection:路由改由注册时的 auth 声明
|
|
5500
|
+
// 负责准入(默认 required,未认证请求在框架层被拦),插件这段手工检查在新宿主上
|
|
5501
|
+
// 已冗余。无守卫直调不存在的方法会抛 TypeError、被下方 catch 统一转成 500,
|
|
5502
|
+
// 全部 RPC(含设置页 getFieldConfig)随之失效(Issue #313)。因此:宿主仍提供
|
|
5503
|
+
// requestRejection 时照旧调用;不存在时跳过手工检查,准入交给框架默认策略。
|
|
5499
5504
|
ctx.inject(['connection', 'webServer'], function (webCtx) {
|
|
5500
5505
|
webCtx.effect(function () {
|
|
5501
5506
|
const dispose = webCtx.webServer.register({
|
|
@@ -5504,7 +5509,9 @@ export default {
|
|
|
5504
5509
|
handler: async function (req, res) {
|
|
5505
5510
|
let method = '';
|
|
5506
5511
|
try {
|
|
5507
|
-
const rejection = webCtx.connection.requestRejection
|
|
5512
|
+
const rejection = typeof webCtx.connection.requestRejection === 'function'
|
|
5513
|
+
? webCtx.connection.requestRejection(req)
|
|
5514
|
+
: undefined;
|
|
5508
5515
|
if (rejection !== undefined) {
|
|
5509
5516
|
respond(res, rejection, { error: rejection === 401 ? 'authentication required' : 'request rejected' });
|
|
5510
5517
|
return;
|