deepseek-harness-background 0.4.0 → 0.4.2

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 CHANGED
@@ -344,7 +344,7 @@ function validateSectionBody(body, home) {
344
344
  const timeline = body.timeline;
345
345
  if (timeline !== void 0 && typeof timeline !== "boolean") return "invalid-timeline";
346
346
  const fit = body.fit;
347
- if (fit !== void 0 && fit !== "" && !FIT_MODES.includes(fit)) return "invalid-fit";
347
+ if (fit !== void 0 && !FIT_MODES.includes(fit)) return "invalid-fit";
348
348
  return null;
349
349
  }
350
350
  /**
@@ -549,7 +549,17 @@ function makeBackgroundRoutes(settings, opts = {}) {
549
549
  }
550
550
  if (!requireMethod(req, res, "GET")) return;
551
551
  const rawPath = new URL(req.url ?? "/", "http://x").pathname;
552
- const abs = uploadPath(rawPath.startsWith(`/api/bg-wallpaper/image/`) ? decodeURIComponent(rawPath.slice(`${BACKGROUND_API_PREFIX}/image/`.length)) : "", opts.home);
552
+ let id = "";
553
+ try {
554
+ id = rawPath.startsWith(`/api/bg-wallpaper/image/`) ? decodeURIComponent(rawPath.slice(`${BACKGROUND_API_PREFIX}/image/`.length)) : "";
555
+ } catch {
556
+ json(res, 404, {
557
+ ok: false,
558
+ error: "not-found"
559
+ });
560
+ return;
561
+ }
562
+ const abs = uploadPath(id, opts.home);
553
563
  if (abs === "") {
554
564
  json(res, 404, {
555
565
  ok: false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "deepseek-harness-background",
3
3
  "description": "Custom background image plugin for the DeepSeek Harness web GUI: upload a local picture or paste an image URL, and render it behind the whole app surface with adjustable opacity, scrim, panel transparency and frosted-glass blur.",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "keywords": [
6
6
  "deepseek-harness",
7
7
  "dsh",