ซอร์สที่เผยแพร่
ดาวน์โหลด ZIP ของซอร์ส
CH-J Server Manager
เรียกดูไดเรกทอรีและไฟล์ของรุ่นแอปพลิเคชันที่ระบุ
CH-J / Server Manager
339 ไฟล์
core-20261014T184258Z-3fbed0b93fdf
วันที่เพิ่ม: ไม่ได้บันทึกวันที่ · วันที่บิลด์:
1
"use strict";3
const test = require("node:test");4
const assert = require("node:assert/strict");5
const { assertAllowedUrl, normalizeBaseUrl } = require("../src/main/security/urlPolicy");7
const bases = [8
"https://sm.ch-j.de/"9
];11
test("base URL normalization preserves the allowed root", () => {12
assert.equal(normalizeBaseUrl("https://sm.ch-j.de").toString(), bases[0]);13
});15
test("allowed API and file URLs pass", () => {16
assert.equal(17
assertAllowedUrl(`${bases[0]}api/latest.php`, bases, { pathSegment: "api/" }).hostname,18
"sm.ch-j.de"19
);20
assert.equal(21
assertAllowedUrl(`${bases[0]}files/apps/win/app.exe`, bases, { pathSegment: "files/" }).hostname,22
"sm.ch-j.de"23
);24
});26
test("foreign hosts, credentials and paths are rejected", () => {27
assert.throws(() => assertAllowedUrl("https://example.com/update.exe", bases), /allowlist/);28
assert.throws(() => assertAllowedUrl("https://admin@sm.ch-j.de/files/a", bases), /credentials/);29
assert.throws(() => assertAllowedUrl(`${bases[0]}admin.php`, bases, { pathSegment: "files/" }), /path/);30
});32
test("HTTP update origins are rejected", () => {33
assert.throws(() => normalizeBaseUrl("http://sm.ch-j.de/"), /HTTPS/);34
});SHA-256
d76d344fc0a131fce6290b1ec7070dbd3c720cdd7b11a86e4330692f4056425bCH-J Proprietary Software License 1.14 · ซอร์สโค้ดนี้ให้ไว้ภายใต้ CH-J Proprietary Software License 1.14 การเปิดให้เข้าถึงไม่ได้เปลี่ยนแปลงเงื่อนไขของสัญญาอนุญาตหรือให้สิทธิ์เพิ่มเติม
SHA-256 ของไฟล์บีบอัด
3df08cf5e899262a6ce92d7ec2caf5c42b683f1f2b57055662b845ff7dde67a8