Skip to content

fix: dapp.conf name sanitisation and SW empty-filename guard#14

Merged
eurobuddha merged 1 commit intomasterfrom
fix/safename-and-sw-guard
Mar 23, 2026
Merged

fix: dapp.conf name sanitisation and SW empty-filename guard#14
eurobuddha merged 1 commit intomasterfrom
fix/safename-and-sw-guard

Conversation

@eurobuddha
Copy link
Copy Markdown
Owner

Summary

  • studio-builder.js: dapp.conf name field now uses a dedicated inline sanitiser that preserves spaces and hyphens (/[^a-zA-Z0-9 \-]/g), collapses whitespace, and trims — rather than safeName() which replaces everything non-alphanumeric with _. safeName() is retained as-is for zip filenames where underscores are correct. Result: "Claude's Art Gallery" → "Claudes Art Gallery" instead of "Claude_s_Art_Gallery".
  • sw.js: Added if (!filename) return; guard before the NETWORK_ONLY_FILES check to explicitly handle directory-style URLs (ending in /) where split('/').pop() returns ''.

🤖 Generated with Claude Code

- studio-builder.js: dapp.conf name field now strips only unsafe chars
  (keeps spaces and hyphens), collapses whitespace, and trims. safeName()
  is kept as-is for zip filenames where underscores are appropriate.
  "Claude's Gallery" → "Claudes Gallery" rather than "Claude_s_Gallery".

- sw.js: guard against empty filename (directory-style URL ending in /)
  before the NETWORK_ONLY_FILES check to prevent a silent edge case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eurobuddha eurobuddha merged commit adffe1f into master Mar 23, 2026
5 checks passed
@eurobuddha eurobuddha deleted the fix/safename-and-sw-guard branch March 23, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant