CH-J Server ManagerSSH के ज़रिए सर्वर प्रबंधन
मेनू
प्रकाशित सोर्स

CH-J Server Manager

किसी विशेष ऐप्लिकेशन रिलीज़ की डायरेक्टरी और फ़ाइलें देखें।

सोर्स ZIP डाउनलोड करें
CH-J / Server Manager 368 फ़ाइलें
core-20261017T201717Z-057348c4a70f जोड़ा गया: तारीख दर्ज नहीं · बिल्ड किया गया:
urlPolicy.test.js जोड़ा गया: तारीख दर्ज नहीं 1.2 KB · 34 पंक्तियाँ
कोड फ़ाइल डाउनलोड करें
1"use strict";
3const test = require("node:test");
4const assert = require("node:assert/strict");
5const { assertAllowedUrl, normalizeBaseUrl } = require("../src/main/security/urlPolicy");
7const bases = [
8 "https://sm.ch-j.de/"
9];
11test("base URL normalization preserves the allowed root", () => {
12 assert.equal(normalizeBaseUrl("https://sm.ch-j.de").toString(), bases[0]);
13});
15test("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});
26test("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});
32test("HTTP update origins are rejected", () => {
33 assert.throws(() => normalizeBaseUrl("http://sm.ch-j.de/"), /HTTPS/);
34});
SHA-256d76d344fc0a131fce6290b1ec7070dbd3c720cdd7b11a86e4330692f4056425b

CH-J Proprietary Software License 1.14 · सोर्स CH-J Proprietary Software License 1.14 के तहत उपलब्ध कराया जाता है। इसकी उपलब्धता लाइसेंस की शर्तें नहीं बदलती और न ही अतिरिक्त अधिकार देती है।

आर्काइव SHA-256cf4455b698f0f28e456a37b1834976a0194d8486acb7101052d59a838745cca3
फ़ाइलें