-
Notifications
You must be signed in to change notification settings - Fork 58
fix: replace non-standard SVG MIME type with image/svg+xml #2410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: replace non-standard SVG MIME type with image/svg+xml #2410
Conversation
|
|
Finished running flow.
|
||||||||||||||||||
|
@AkhmetovOlzhass is attempting to deploy a commit to the Giselle Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughTightened SVG MIME handling: replaced non-standard Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (8)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development-guide.mdc)
Files:
**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/development-guide.mdc)
Files:
**/*.{js,ts,tsx,jsx,py,java,cs,cpp,c,go,rb,php,swift,kt,scala,rs,dart}📄 CodeRabbit inference engine (.cursor/rules/language-support.mdc)
Files:
**/*📄 CodeRabbit inference engine (.cursor/rules/naming-guide.mdc)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/naming-guide.mdc)
Files:
**/*.{ts,tsx,js,jsx,css}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{tsx,ts}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (11)📓 Common learnings📚 Learning: 2025-11-25T03:07:19.740ZApplied to files:
📚 Learning: 2025-11-25T03:07:19.740ZApplied to files:
📚 Learning: 2025-11-25T03:07:19.740ZApplied to files:
📚 Learning: 2025-11-25T03:05:31.051ZApplied to files:
📚 Learning: 2025-11-25T03:07:19.740ZApplied to files:
📚 Learning: 2025-05-29T01:36:42.353ZApplied to files:
📚 Learning: 2025-11-25T03:07:19.740ZApplied to files:
📚 Learning: 2025-11-25T03:07:19.740ZApplied to files:
📚 Learning: 2025-11-25T03:05:31.051ZApplied to files:
📚 Learning: 2025-11-25T03:07:07.498ZApplied to files:
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
🔍 QA Testing Assistant by Giselle📋 Manual QA ChecklistBased on the changes in this PR, here are the key areas to test manually:
✨ Prompt for AI AgentsUse the following prompts with Cursor or Claude Code to automate E2E testing: 📝 E2E Test Generation Prompt |
shige
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AkhmetovOlzhass I would be grateful if you could fix the following!
Issue: RegExp special character breaks SVG file validation
The validation logic uses new RegExp(accept).test(itemType) to check MIME types, but image/svg+xml contains a + character which is a special regex metacharacter meaning "one or more occurrences".
When image/svg+xml is interpreted as a regex pattern:
- It matches: image/svgxml, image/svgxxml, etc.
- It does not match: image/svg+xml (the actual MIME type)
Suggested fix options:
- Escape the regex special character: accept: ["image/png", "image/jpeg", "image/gif", "image/svg\+xml"],
- Use simple string comparison instead of RegExp (recommended): isValid = config.accept.some((accept) => accept === itemType);
- Or if partial matching is needed: isValid = config.accept.some((accept) => itemType.startsWith(accept));
Option 2 is recommended since MIME type validation doesn't require regex complexity.
Affected locations:
- file-panel.tsx:134 - validateItems function
- file-panel.tsx:159 - assertFiles function
User description
Summary
Fixes #2402
Replaces the non-standard MIME type "image/svg" with the correct
"image/svg+xml" across the project.
Changes
Testing
Verified that the correct MIME type is now used across all components.
PR Type
Bug fix
Description
Replace non-standard "image/svg" MIME type with correct "image/svg+xml"
Update SVG MIME type in generation executor, file panel, and file node properties
Ensure consistent and standards-compliant MIME type usage across components
Diagram Walkthrough
File Walkthrough
use-generation-executor.ts
Update SVG MIME type in generation executorpackages/giselle/src/generations/internal/use-generation-executor.ts
case statement
file-panel.tsx
Update SVG MIME type in file panel error handlinginternal-packages/workflow-designer-ui/src/editor/properties-panel/file-node-properties-panel/file-panel.tsx
message switch case
index.tsx
Update SVG MIME type in file type configurationinternal-packages/workflow-designer-ui/src/editor/properties-panel/file-node-properties-panel/index.tsx
configuration
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.