fix: dapp.conf name sanitisation and SW empty-filename guard#14
Merged
eurobuddha merged 1 commit intomasterfrom Mar 23, 2026
Merged
fix: dapp.conf name sanitisation and SW empty-filename guard#14eurobuddha merged 1 commit intomasterfrom
eurobuddha merged 1 commit intomasterfrom
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dapp.confnamefield now uses a dedicated inline sanitiser that preserves spaces and hyphens (/[^a-zA-Z0-9 \-]/g), collapses whitespace, and trims — rather thansafeName()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".if (!filename) return;guard before theNETWORK_ONLY_FILEScheck to explicitly handle directory-style URLs (ending in/) wheresplit('/').pop()returns''.🤖 Generated with Claude Code