CH-J Server ManagerSSH를 통한 서버 관리
메뉴
공개된 소스

CH-J Server Manager

특정 애플리케이션 릴리스의 디렉터리와 파일을 살펴보세요.

소스 ZIP 다운로드
CH-J / Server Manager 377 개 파일
core-20261019T111616Z-160a00bfcddc 추가됨: · 빌드됨:
urlPolicy.js 추가됨: 날짜 기록 없음 1.5 KB · 40 줄
코드 파일 다운로드
1"use strict";
3function normalizeBaseUrl(value) {
4 const url = new URL(String(value || ""));
5 if (url.protocol !== "https:") throw new Error("Update URL must use HTTPS.");
6 if (url.username || url.password || url.hash || url.search) throw new Error("Invalid update base URL.");
7 url.pathname = `${url.pathname.replace(/\/+$/, "")}/`;
8 return url;
9}
11function assertAllowedUrl(candidate, allowedBaseUrls, options = {}) {
12 const raw = String(candidate || "").trim();
13 if (!raw) throw new Error("Missing URL.");
14 const bases = allowedBaseUrls.map(normalizeBaseUrl);
16 if (raw.startsWith("/")) {
17 if (!options.baseUrl) throw new Error("Relative URL requires a base URL.");
18 return assertAllowedUrl(new URL(raw.replace(/^\/+/, ""), normalizeBaseUrl(options.baseUrl)).toString(), allowedBaseUrls, options);
19 }
21 const url = new URL(raw);
22 if (url.username || url.password || url.hash) throw new Error("URL credentials and fragments are not allowed.");
23 const matchedBase = bases.find((base) => (
24 url.protocol === base.protocol
25 && url.hostname === base.hostname
26 && url.port === base.port
27 && url.pathname.startsWith(base.pathname)
28 ));
29 if (!matchedBase) throw new Error("URL is outside the update allowlist.");
31 if (options.pathSegment && !url.pathname.startsWith(`${matchedBase.pathname}${options.pathSegment}`)) {
32 throw new Error("URL path is outside the allowed update area.");
33 }
34 return url;
37module.exports = {
38 assertAllowedUrl,
39 normalizeBaseUrl
40};
SHA-256db15c1e8b5a134391637a8de3efca895dcbf77095a5eaf58acba061b69775030

CH-J Proprietary Software License 1.14 · 소스는 CH-J Proprietary Software License 1.14에 따라 제공됩니다. 소스를 공개한다고 해서 라이선스 조항이 바뀌거나 추가 권리가 부여되지는 않습니다.

압축 파일 SHA-256a9605c0870a223b6a8542bb0705edd51d8b04f3069582653417a8397fabcc09a
파일