clay-server 2.25.0 → 2.25.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -187,22 +187,18 @@ export function svgToPngDataUrl(svgEl) {
187
187
  var svgBlob = new Blob([svgStr], { type: "image/svg+xml;charset=utf-8" });
188
188
  var url = URL.createObjectURL(svgBlob);
189
189
 
190
- // Inline external styles into SVG to avoid tainted canvas from cross-origin refs
191
- var styleSheets = "";
192
- try {
193
- var computed = svgEl.querySelectorAll("style");
194
- for (var si = 0; si < computed.length; si++) {
195
- styleSheets += computed[si].textContent;
196
- }
197
- } catch (e) {}
198
- // Strip any external references (url(), @import) that would taint the canvas
199
- svgStr = svgStr.replace(/@import\s+url\([^)]*\)[^;]*;?/g, "");
190
+ // Strip all external references that would taint the canvas
191
+ // 1. @import rules
192
+ svgStr = svgStr.replace(/@import\s+[^;]*;?/g, "");
193
+ // 2. CSS url() pointing to external resources (keep data: and fragment-only refs)
194
+ svgStr = svgStr.replace(/url\(\s*['"]?(?!data:|#)([^'")]+)['"]?\s*\)/g, "url()");
195
+ // 3. xlink:href / href attributes pointing to external URLs
196
+ svgStr = svgStr.replace(/(xlink:href|href)\s*=\s*["'](?!#|data:)[^"']*["']/g, '$1=""');
200
197
  svgBlob = new Blob([svgStr], { type: "image/svg+xml;charset=utf-8" });
201
198
  URL.revokeObjectURL(url);
202
199
  url = URL.createObjectURL(svgBlob);
203
200
 
204
201
  var img = new Image();
205
- img.crossOrigin = "anonymous";
206
202
  img.onload = function () {
207
203
  var canvas = document.createElement("canvas");
208
204
  canvas.width = w;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clay-server",
3
- "version": "2.25.0",
3
+ "version": "2.25.1-beta.1",
4
4
  "description": "Self-hosted Claude Code in your browser. Multi-session, multi-user, push notifications.",
5
5
  "bin": {
6
6
  "clay-server": "./bin/cli.js",