fix windows "Forbidden" regression

This commit is contained in:
Egor 2025-12-31 10:16:05 -08:00
parent 3803cdd82d
commit 630486e47a
3 changed files with 9 additions and 9 deletions

View file

@ -1,7 +1,7 @@
{
"name": "gerbil",
"productName": "Gerbil",
"version": "1.18.2",
"version": "1.18.3",
"description": "Run Large Language Models locally",
"main": "out/main/index.js",
"homepage": "./",
@ -58,7 +58,7 @@
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
"remark-gfm": "^4.0.1",
"systeminformation": "^5.28.6",
"systeminformation": "^5.28.7",
"winston": "^3.19.0",
"winston-daily-rotate-file": "^5.0.0",
"yauzl": "^3.2.0",

View file

@ -1,6 +1,6 @@
import { createServer, Server } from 'http';
import { readFile } from 'fs/promises';
import { join, normalize, resolve as resolvePath } from 'path';
import { join, normalize, resolve as resolvePath, sep } from 'path';
import { lookup } from 'mime-types';
import { pathExists } from '@/utils/node/fs';
@ -17,7 +17,7 @@ export const startStaticServer = (distPath: string) =>
const resolvedDistPath = resolvePath(distPath);
if (
!normalizedPath.startsWith(resolvedDistPath + '/') &&
!normalizedPath.startsWith(resolvedDistPath + sep) &&
normalizedPath !== resolvedDistPath
) {
res.writeHead(403);

View file

@ -4165,7 +4165,7 @@ __metadata:
rehype-sanitize: "npm:^6.0.0"
remark-gfm: "npm:^4.0.1"
rollup-plugin-visualizer: "npm:^6.0.5"
systeminformation: "npm:^5.28.6"
systeminformation: "npm:^5.28.7"
typescript: "npm:^5.9.3"
vite: "npm:^7.3.0"
winston: "npm:^3.19.0"
@ -7839,12 +7839,12 @@ __metadata:
languageName: node
linkType: hard
"systeminformation@npm:^5.28.6":
version: 5.28.6
resolution: "systeminformation@npm:5.28.6"
"systeminformation@npm:^5.28.7":
version: 5.28.7
resolution: "systeminformation@npm:5.28.7"
bin:
systeminformation: lib/cli.js
checksum: 10c0/375c9ada7e437bd29f9b9e341eb43af1853ba2ac51d43a504352e32cb93f181d34b6a8729ef05cb4bb6d6bbe54eaa454494a05c0b6fd3a580943adcb67ce9d3a
checksum: 10c0/dbf7fd3f893ad84032399e4c81147715933f80e3b11bc0c2c59a14948be488404a0de49407253bcc1b9fae6ef2b8c25a9798ed4424158c70730a44e4b138aa71
conditions: (os=darwin | os=linux | os=win32 | os=freebsd | os=openbsd | os=netbsd | os=sunos | os=android)
languageName: node
linkType: hard