Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): cite text inside inline HTML renders #17023

Closedjakeleventhal(GitHub profile, opens in a new tab)wants to merge 19 commits intomain fromrefs/pull/17023/headopened View on GitHub

Showing 20 changed files with 92 additions and 1 deletion (loading 17).

x
0 of 20 viewed, 20 left
71 additions and 1 deletionapps/server/src/assets/AssetAccess.test.tsModified
View file
@@ -30,7 +30,7 @@
import * as ProjectFaviconResolver from "../project/ProjectFaviconResolver.ts";
import * as T3ProjectFileLoader from "../project/T3ProjectFileLoader.ts";
import * as WorkspacePaths from "../workspace/WorkspacePaths.ts";
-import { assetFileResponse } from "../http.ts";
+import { assetFileResponse, assetResponseHeaders } from "../http.ts";
import { ASSET_ROUTE_PREFIX, issueAssetUrl, readMcpAppHtml, resolveAsset } from "./AssetAccess.ts";
import * as NativeAppIconResolver from "./NativeAppIconResolver.ts";
import { symlinksSupported } from "@t3tools/shared/testing/symlinks";
@@ -1323,6 +1323,76 @@
}).pipe(Effect.provide(layerTest)),
+ it.effect(
+ "serves selection-enabled saved HTML at its signed URL with its own sandbox policy",
+ () =>
+ Effect.gen(function* () {
+ const config = yield* ServerConfig.ServerConfig;
+ const fs = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const attachmentId = "thread-1-00000000-0000-4000-8000-000000000004-html";
+ const filePath = path.join(config.attachmentsDir, `${attachmentId}.html`);
+ const html =
+ '<html><head><script src="//cdn.example/library.js"></script><link rel="stylesheet" href="style.css"></head><body><p>Saved quote</p></body></html>';
+ yield* fs.makeDirectory(config.attachmentsDir, { recursive: true });
+ yield* fs.writeFileString(filePath, html);
+ const urls = [];
+ for (const disposition of ["inline", "attachment"] as const) {
+ const result = yield* issueAssetUrl({