- revert unrelated server-side attachment/image changes from this branch\n- keep changed-files tree UX fixes (icons, directory behavior, whitespace-safe paths, stat visibility)\n\nCo-authored-by: codex <codex@users.noreply.github.com>
Showing the changes to apps/server/src/wsServer.ts (1 of 14 files). Show all
Unified · Split
| @@ -60,9 +60,9 @@ import { ServerConfig } from "./config"; · 59 unmodified lines | |||
| 60 | import { GitCore } from "./git/Services/GitCore.ts"; | 60 | import { GitCore } from "./git/Services/GitCore.ts"; |
| 61 | import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute"; | 61 | import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute"; |
| 62 | import { | 62 | import { |
| 63 | ATTACHMENTS_ROUTE_PREFIX, | ||
| 63 | normalizeAttachmentRelativePath, | 64 | normalizeAttachmentRelativePath, |
| 64 | resolveAttachmentRelativePath, | 65 | resolveAttachmentRelativePath, |
| 65 | stripAttachmentRoutePrefix, | ||
| 66 | } from "./attachmentPaths"; | 66 | } from "./attachmentPaths"; |
| 67 | import { | 67 | import { |
| 68 | createAttachmentId, | 68 | createAttachmentId, |
| @@ -350,9 +350,9 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< · 281 unmodified lines | |||
| 350 | return; | 350 | return; |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | const routeRelativePath = stripAttachmentRoutePrefix(url.pathname); | 353 | if (url.pathname.startsWith(ATTACHMENTS_ROUTE_PREFIX)) { |
| 354 | if (routeRelativePath !== null) { | 354 | const rawRelativePath = url.pathname.slice(ATTACHMENTS_ROUTE_PREFIX.length); |
| 355 | const normalizedRelativePath = normalizeAttachmentRelativePath(routeRelativePath); | 355 | const normalizedRelativePath = normalizeAttachmentRelativePath(rawRelativePath); |
| 356 | if (!normalizedRelativePath) { | 356 | if (!normalizedRelativePath) { |
| 357 | respond(400, { "Content-Type": "text/plain" }, "Invalid attachment path"); | 357 | respond(400, { "Content-Type": "text/plain" }, "Invalid attachment path"); |
| 358 | return; | 358 | return; |