History

Scope changed-files tree PR to relevant files

- 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>

Julius Marminge committed 8 months ago

Commit 6841fa11 parent 5c0380414 files · +38 −69Browse files

Showing the changes to apps/server/src/wsServer.ts (1 of 14 files). Show all

Unified · Split

apps/server/src/wsServer.ts+4−4
@@ -60,9 +60,9 @@ import { ServerConfig } from "./config"; · 59 unmodified lines
6060 import { GitCore } from "./git/Services/GitCore.ts";
6161 import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute";
6262 import {
63+ ATTACHMENTS_ROUTE_PREFIX,
6364 normalizeAttachmentRelativePath,
6465 resolveAttachmentRelativePath,
65− stripAttachmentRoutePrefix,
6666 } from "./attachmentPaths";
6767 import {
6868 createAttachmentId,
@@ -350,9 +350,9 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< · 281 unmodified lines
350350 return;
351351 }
352352
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);
356356 if (!normalizedRelativePath) {
357357 respond(400, { "Content-Type": "text/plain" }, "Invalid attachment path");
358358 return;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t