refactor(server): serve raw filesystem content (#31911)

This commit is contained in:
Dax
2026-06-11 11:20:11 -04:00
committed by GitHub
parent 31b233e9db
commit 31c5454ee6
12 changed files with 67 additions and 93 deletions
@@ -709,10 +709,18 @@ const scenarios: Scenario[] = [
"status",
),
http.protected
.get("/api/fs/read", "v2.fs.read")
.get("/api/fs/read/*", "v2.fs.read")
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
.at((ctx) => ({ path: "/api/fs/read?path=hello.txt", headers: ctx.headers() }))
.json(200, locationData(object)),
.at((ctx) => ({ path: "/api/fs/read/hello.txt", headers: ctx.headers() }))
.status(
200,
(_ctx, result) =>
Effect.sync(() => {
check(result.text === "hello\n", "v2 fs read should return the file body")
check(result.contentType.includes("text/plain"), "v2 fs read should return the file content type")
}),
"status",
),
http.protected.get("/api/fs/list", "v2.fs.list").json(200, locationData(array)),
http.protected
.get("/api/fs/find", "v2.fs.find")