The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 11:00 UTC
nit
Julius Marminge committed
Feb 28, 2026 at 23:14 UTC
5144d32b771cb64c7e6e7aa0d109e480a4382a01
5 files changed
+11
-11
apps/server/src/attachmentPaths.ts
+2
-6
@@ -1,14 +1,10 @@
1
import path from "node:path";
2
3
-import { ATTACHMENTS_ROUTE_PREFIX } from "./projectFaviconRoute.ts";
3
+import { ATTACHMENTS_ROUTE_PREFIX } from "./imageMime.ts";
4
5
export function normalizeAttachmentRelativePath(rawRelativePath: string): string | null {
6
const normalized = path.normalize(rawRelativePath).replace(/^[/\\]+/, "");
7
- if (
8
- normalized.length === 0 ||
9
- normalized.startsWith("..") ||
10
- normalized.includes("\0")
11
- ) {
7
+ if (normalized.length === 0 || normalized.startsWith("..") || normalized.includes("\0")) {
8
return null;
9
}
10
return normalized.replace(/\\/g, "/");
apps/server/src/imageMime.ts
+2
@@ -1,5 +1,7 @@
1
import Mime from "@effect/platform-node/Mime";
2
3
+export const ATTACHMENTS_ROUTE_PREFIX = "/attachments";
4
+
5
export const IMAGE_EXTENSION_BY_MIME_TYPE: Record<string, string> = {
6
"image/avif": ".avif",
7
"image/bmp": ".bmp",
apps/server/src/orchestration/Layers/ProjectionPipeline.ts
+5
-2
@@ -38,8 +38,11 @@ import {
38
type OrchestrationProjectionPipelineShape,
39
} from "../Services/ProjectionPipeline.ts";
40
import { attachmentRouteToRelativePath } from "../../attachmentPaths.ts";
41
-import { ATTACHMENTS_ROUTE_PREFIX } from "../../projectFaviconRoute.ts";
42
-import { inferImageExtension, parseBase64DataUrl } from "../../imageMime.ts";
41
+import {
42
+ ATTACHMENTS_ROUTE_PREFIX,
43
+ inferImageExtension,
44
+ parseBase64DataUrl,
45
+} from "../../imageMime.ts";
46
47
export const ORCHESTRATION_PROJECTOR_NAMES = {
48
projects: "projection.projects",
apps/server/src/projectFaviconRoute.ts
-2
@@ -2,8 +2,6 @@ import fs from "node:fs";
2
import http from "node:http";
3
import path from "node:path";
4
5
-export const ATTACHMENTS_ROUTE_PREFIX = "/attachments";
6
-
5
const FAVICON_MIME_TYPES: Record<string, string> = {
6
".png": "image/png",
7
".jpg": "image/jpeg",
apps/server/src/wsServer.ts
+2
-1
@@ -54,8 +54,9 @@ import { clamp } from "effect/Number";
54
import { Open } from "./open";
55
import { ServerConfig } from "./config";
56
import { GitCore } from "./git/Services/GitCore.ts";
57
-import { ATTACHMENTS_ROUTE_PREFIX, tryHandleProjectFaviconRequest } from "./projectFaviconRoute";
57
+import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute";
58
import { normalizeAttachmentRelativePath, resolveAttachmentRelativePath } from "./attachmentPaths";
59
+import { ATTACHMENTS_ROUTE_PREFIX } from "./imageMime.ts";
60
61
/**
62
* ServerShape - Service API for server lifecycle control.