Skip to content

Commit 1251b18

Browse files
Elaine YINclaude
authored andcommitted
fix(image): prevent URL truncation in --subject-ref parsing
split('=') broke URLs containing = in query params. Now splits only on the first = per key-value pair, preserving the full URL value. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 920273d commit 1251b18

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/commands/image/generate.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export default defineCommand({
5656
if (flags.subjectRef) {
5757
const refStr = flags.subjectRef as string;
5858
const params = Object.fromEntries(
59-
refStr.split(',').map(p => p.split('=') as [string, string]),
59+
refStr.split(',').map(p => {
60+
const eqIdx = p.indexOf('=');
61+
if (eqIdx === -1) return [p, ''];
62+
return [p.slice(0, eqIdx), p.slice(eqIdx + 1)];
63+
}),
6064
);
6165

6266
const ref: { type: string; image_url?: string; image_file?: string } = {

0 commit comments

Comments
 (0)