- 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 | 60 | import { GitCore } from "./git/Services/GitCore.ts"; |
| 61 | 61 | import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute"; |
| 62 | 62 | import { |
| 63 | + ATTACHMENTS_ROUTE_PREFIX, | |
| 63 | 64 | normalizeAttachmentRelativePath, |
| 64 | 65 | resolveAttachmentRelativePath, |
| 65 | − stripAttachmentRoutePrefix, | |
| 66 | 66 | } from "./attachmentPaths"; |
| 67 | 67 | import { |
| 68 | 68 | createAttachmentId, |
| @@ -350,9 +350,9 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< · 281 unmodified lines | ||
| 350 | 350 | return; |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | − const routeRelativePath = stripAttachmentRoutePrefix(url.pathname); | |
| 354 | − if (routeRelativePath !== null) { | |
| 355 | − const normalizedRelativePath = normalizeAttachmentRelativePath(routeRelativePath); | |
| 353 | + if (url.pathname.startsWith(ATTACHMENTS_ROUTE_PREFIX)) { | |
| 354 | + const rawRelativePath = url.pathname.slice(ATTACHMENTS_ROUTE_PREFIX.length); | |
| 355 | + const normalizedRelativePath = normalizeAttachmentRelativePath(rawRelativePath); | |
| 356 | 356 | if (!normalizedRelativePath) { |
| 357 | 357 | respond(400, { "Content-Type": "text/plain" }, "Invalid attachment path"); |
| 358 | 358 | return; |